Commit 401ccd3b authored by Natalie Chouinard's avatar Natalie Chouinard Committed by Commit Bot

Move LocationSettings to chrome/browser/geolocation

The remaining LocationSettings JNI methods are not used by the Clank
Settings screen. Move them alongside the geolocation code that uses
them and build LocationSettings.java to a separate modular java target.

Bug: 1043229
Change-Id: I600e4e48c08216692d57e64d66ac5f74859df7b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2008433
Commit-Queue: Natalie Chouinard <chouinard@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarTim Volodine <timvolodine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735213}
parent 197f68ce
......@@ -249,6 +249,7 @@ android_library("chrome_java") {
"//chrome/browser/android/thin_webview:java",
"//chrome/browser/download/android:java",
"//chrome/browser/flags:java",
"//chrome/browser/geolocation/android:java",
"//chrome/browser/image_fetcher:java",
"//chrome/browser/notifications/chime/android:java",
"//chrome/browser/preferences:java",
......@@ -526,6 +527,7 @@ group("jni_headers") {
"//chrome/android/public/profiles:jni_headers",
"//chrome/browser/download/android:jni_headers",
"//chrome/browser/flags:jni_headers",
"//chrome/browser/geolocation/android:jni_headers",
"//chrome/browser/image_fetcher:jni_headers",
"//chrome/browser/preferences:jni_headers",
"//chrome/browser/touch_to_fill/android:jni_headers",
......@@ -2759,7 +2761,6 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/send_tab_to_self/SendTabToSelfInfoBar.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/SendTabToSelfModelObserverBridge.java",
"java/src/org/chromium/chrome/browser/send_tab_to_self/TargetDeviceInfo.java",
"java/src/org/chromium/chrome/browser/settings/LocationSettings.java",
"java/src/org/chromium/chrome/browser/settings/NfcSystemLevelSetting.java",
"java/src/org/chromium/chrome/browser/settings/about/AboutSettingsBridge.java",
"java/src/org/chromium/chrome/browser/settings/autofill/AutofillProfileBridge.java",
......
......@@ -1366,7 +1366,6 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java",
"java/src/org/chromium/chrome/browser/settings/HyperlinkPreference.java",
"java/src/org/chromium/chrome/browser/settings/LearnMorePreference.java",
"java/src/org/chromium/chrome/browser/settings/LocationSettings.java",
"java/src/org/chromium/chrome/browser/settings/MainSettings.java",
"java/src/org/chromium/chrome/browser/settings/NfcSystemLevelSetting.java",
"java/src/org/chromium/chrome/browser/settings/SettingsActivity.java",
......
......@@ -2532,9 +2532,6 @@ jumbo_static_library("browser") {
"android/locale/locale_manager.h",
"android/locale/locale_template_url_loader.cc",
"android/locale/locale_template_url_loader.h",
"android/location_settings.h",
"android/location_settings_impl.cc",
"android/location_settings_impl.h",
"android/logo_bridge.cc",
"android/logo_bridge.h",
"android/media/media_capture_devices_dispatcher_android.cc",
......@@ -2808,6 +2805,9 @@ jumbo_static_library("browser") {
"first_run/android/first_run_utils.cc",
"flags/android/chrome_feature_list.cc",
"flags/android/chrome_feature_list.h",
"geolocation/android/location_settings.h",
"geolocation/android/location_settings_impl.cc",
"geolocation/android/location_settings_impl.h",
"history/android/android_history_provider_service.cc",
"history/android/android_history_provider_service.h",
"history/android/android_provider_backend.cc",
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/rules.gni")
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/geolocation/LocationSettings.java",
]
deps = [
"//base:base_java",
"//base:jni_java",
"//components/location/android:location_java",
"//content/public/android:content_java",
"//ui/android:ui_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chrome/browser/geolocation/LocationSettings.java",
]
}
include_rules = [
"+content/public/android/java/src/org/chromium/content_public",
]
\ No newline at end of file
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.settings;
package org.chromium.chrome.browser.geolocation;
import android.Manifest;
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_H_
#define CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_H_
#ifndef CHROME_BROWSER_GEOLOCATION_ANDROID_LOCATION_SETTINGS_H_
#define CHROME_BROWSER_GEOLOCATION_ANDROID_LOCATION_SETTINGS_H_
#include "base/callback.h"
#include "base/macros.h"
......@@ -59,4 +59,4 @@ class LocationSettings {
LocationSettingsDialogOutcomeCallback callback) = 0;
};
#endif // CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_H_
#endif // CHROME_BROWSER_GEOLOCATION_ANDROID_LOCATION_SETTINGS_H_
......@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/android/location_settings_impl.h"
#include "chrome/browser/geolocation/android/location_settings_impl.h"
#include "base/android/jni_android.h"
#include "chrome/android/chrome_jni_headers/LocationSettings_jni.h"
#include "chrome/browser/geolocation/android/jni_headers/LocationSettings_jni.h"
#include "content/public/browser/web_contents.h"
using base::android::AttachCurrentThread;
......
......@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_
#define CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_
#ifndef CHROME_BROWSER_GEOLOCATION_ANDROID_LOCATION_SETTINGS_IMPL_H_
#define CHROME_BROWSER_GEOLOCATION_ANDROID_LOCATION_SETTINGS_IMPL_H_
#include <memory>
#include "base/android/jni_weak_ref.h"
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
#include "chrome/browser/android/location_settings.h"
#include "chrome/browser/geolocation/android/location_settings.h"
class LocationSettingsImpl : public LocationSettings {
public:
......@@ -32,4 +32,4 @@ class LocationSettingsImpl : public LocationSettings {
DISALLOW_COPY_AND_ASSIGN(LocationSettingsImpl);
};
#endif // CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_
#endif // CHROME_BROWSER_GEOLOCATION_ANDROID_LOCATION_SETTINGS_IMPL_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/android/mock_location_settings.h"
#include "chrome/browser/geolocation/android/mock_location_settings.h"
#include "base/lazy_instance.h"
......@@ -22,11 +22,9 @@ static base::LazyInstance<
} // namespace
MockLocationSettings::MockLocationSettings() : LocationSettings() {
}
MockLocationSettings::MockLocationSettings() : LocationSettings() {}
MockLocationSettings::~MockLocationSettings() {
}
MockLocationSettings::~MockLocationSettings() {}
void MockLocationSettings::SetLocationStatus(
bool has_android_location_permission,
......
......@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_MOCK_LOCATION_SETTINGS_H_
#define CHROME_BROWSER_ANDROID_MOCK_LOCATION_SETTINGS_H_
#ifndef CHROME_BROWSER_GEOLOCATION_ANDROID_MOCK_LOCATION_SETTINGS_H_
#define CHROME_BROWSER_GEOLOCATION_ANDROID_MOCK_LOCATION_SETTINGS_H_
#include "base/macros.h"
#include "chrome/browser/android/location_settings.h"
#include "chrome/browser/geolocation/android/location_settings.h"
#include "components/location/android/location_settings_dialog_context.h"
#include "components/location/android/location_settings_dialog_outcome.h"
......@@ -42,4 +42,4 @@ class MockLocationSettings : public LocationSettings {
DISALLOW_COPY_AND_ASSIGN(MockLocationSettings);
};
#endif // CHROME_BROWSER_ANDROID_MOCK_LOCATION_SETTINGS_H_
#endif // CHROME_BROWSER_GEOLOCATION_ANDROID_MOCK_LOCATION_SETTINGS_H_
......@@ -10,10 +10,10 @@
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "chrome/browser/android/location_settings.h"
#include "chrome/browser/android/location_settings_impl.h"
#include "chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.h"
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/geolocation/android/location_settings.h"
#include "chrome/browser/geolocation/android/location_settings_impl.h"
#include "chrome/browser/permissions/permission_uma_util.h"
#include "chrome/browser/permissions/permission_update_infobar_delegate_android.h"
#include "chrome/browser/profiles/profile.h"
......
......@@ -25,7 +25,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "chrome/browser/android/location_settings.h"
#include "chrome/browser/geolocation/android/location_settings.h"
#include "chrome/browser/geolocation/geolocation_permission_context.h"
#include "components/location/android/location_settings_dialog_context.h"
#include "components/location/android/location_settings_dialog_outcome.h"
......
......@@ -56,8 +56,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_ANDROID)
#include "chrome/browser/android/mock_location_settings.h"
#include "chrome/browser/android/search_permissions/search_permissions_service.h"
#include "chrome/browser/geolocation/android/mock_location_settings.h"
#include "chrome/browser/geolocation/geolocation_permission_context_android.h"
#include "components/location/android/location_settings_dialog_outcome.h"
#include "components/prefs/pref_service.h"
......
......@@ -34,8 +34,8 @@
#if defined(OS_ANDROID)
#include "base/android/build_info.h"
#include "chrome/browser/android/mock_location_settings.h"
#include "chrome/browser/flags/android/chrome_feature_list.h"
#include "chrome/browser/geolocation/android/mock_location_settings.h"
#include "chrome/browser/geolocation/geolocation_permission_context_android.h"
#endif // defined(OS_ANDROID)
......
......@@ -3015,8 +3015,6 @@ test("unit_tests") {
"../browser/android/customtabs/detached_resource_request_unittest.cc",
"../browser/android/favicon_helper_unittest.cc",
"../browser/android/metrics/background_task_memory_metrics_emitter_unittest.cc",
"../browser/android/mock_location_settings.cc",
"../browser/android/mock_location_settings.h",
"../browser/android/mock_nfc_system_level_setting.cc",
"../browser/android/mock_nfc_system_level_setting.h",
"../browser/android/oom_intervention/near_oom_monitor_unittest.cc",
......@@ -3122,6 +3120,8 @@ test("unit_tests") {
"../browser/external_protocol/external_protocol_handler_unittest.cc",
"../browser/file_select_helper_unittest.cc",
"../browser/font_pref_change_notifier_unittest.cc",
"../browser/geolocation/android/mock_location_settings.cc",
"../browser/geolocation/android/mock_location_settings.h",
"../browser/geolocation/geolocation_permission_context_unittest.cc",
"../browser/global_keyboard_shortcuts_mac_unittest.mm",
"../browser/google/google_search_domain_mixing_metrics_emitter_factory_unittest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment