Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: chrome/browser/android/location_settings_impl.h

Issue 2709883005: Stubs for triggering the LSD in Clank (Closed)
Patch Set: Declare the dependency of components/location on WindowAndroid Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_
6 #define CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_ 6 #define CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h" 11 #include "base/android/scoped_java_ref.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/android/location_settings.h" 13 #include "chrome/browser/android/location_settings.h"
14 14
15 class LocationSettingsImpl : public LocationSettings { 15 class LocationSettingsImpl : public LocationSettings {
16 public: 16 public:
17 LocationSettingsImpl(); 17 LocationSettingsImpl();
18 ~LocationSettingsImpl() override; 18 ~LocationSettingsImpl() override;
19 19
20 // LocationSettings implementation: 20 // LocationSettings implementation:
21 bool CanSitesRequestLocationPermission( 21 bool CanSitesRequestLocationPermission(
22 content::WebContents* web_contents) override; 22 content::WebContents* web_contents) override;
23 23
24 void CanPromptToEnableSystemLocationSetting(
25 const base::Callback<void(bool can_prompt)>& callback) override;
26
27 void PromptToEnableSystemLocationSetting(
28 const PromptContext prompt_context,
29 content::WebContents* web_contents,
30 const base::Callback<void(PromptOutcome prompt_outcome)>& callback)
31 override;
32
33 // JNI classes and methods.
34 class BoolCallback {
35 public:
36 explicit BoolCallback(
37 const base::Callback<void(bool can_prompt)>& callback);
38 ~BoolCallback();
39
40 void RunBoolCallback(JNIEnv* env,
41 const base::android::JavaParamRef<jobject>& obj,
42 bool result);
43
44 private:
45 const base::Callback<void(bool can_prompt)> callback_;
46 };
47
48 class PromptOutcomeCallback {
49 public:
50 explicit PromptOutcomeCallback(
51 const base::Callback<void(PromptOutcome prompt_outcome)>& callback);
52 ~PromptOutcomeCallback();
53
54 void RunPromptOutcomeCallback(
55 JNIEnv* env,
56 const base::android::JavaParamRef<jobject>& obj,
57 int result);
58
59 private:
60 const base::Callback<void(PromptOutcome prompt_outcome)> callback_;
61 };
62
63 // Register the location settings native methods through JNI.
64 static bool Register(JNIEnv* env);
65
24 private: 66 private:
25 DISALLOW_COPY_AND_ASSIGN(LocationSettingsImpl); 67 DISALLOW_COPY_AND_ASSIGN(LocationSettingsImpl);
26 }; 68 };
27 69
28 #endif // CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_ 70 #endif // CHROME_BROWSER_ANDROID_LOCATION_SETTINGS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698