| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 : public content::GeolocationPermissionContext { | 25 : public content::GeolocationPermissionContext { |
| 26 public: | 26 public: |
| 27 explicit ChromeGeolocationPermissionContext(Profile* profile); | 27 explicit ChromeGeolocationPermissionContext(Profile* profile); |
| 28 | 28 |
| 29 // GeolocationPermissionContext: | 29 // GeolocationPermissionContext: |
| 30 virtual void RequestGeolocationPermission( | 30 virtual void RequestGeolocationPermission( |
| 31 int render_process_id, | 31 int render_process_id, |
| 32 int render_view_id, | 32 int render_view_id, |
| 33 int bridge_id, | 33 int bridge_id, |
| 34 const GURL& requesting_frame, | 34 const GURL& requesting_frame, |
| 35 bool user_gesture, |
| 35 base::Callback<void(bool)> callback) OVERRIDE; | 36 base::Callback<void(bool)> callback) OVERRIDE; |
| 36 virtual void CancelGeolocationPermissionRequest( | 37 virtual void CancelGeolocationPermissionRequest( |
| 37 int render_process_id, | 38 int render_process_id, |
| 38 int render_view_id, | 39 int render_view_id, |
| 39 int bridge_id, | 40 int bridge_id, |
| 40 const GURL& requesting_frame) OVERRIDE; | 41 const GURL& requesting_frame) OVERRIDE; |
| 41 | 42 |
| 42 // Called on the UI thread when the profile is about to be destroyed. | 43 // Called on the UI thread when the profile is about to be destroyed. |
| 43 void ShutdownOnUIThread(); | 44 void ShutdownOnUIThread(); |
| 44 | 45 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 PermissionQueueController* QueueController(); | 62 PermissionQueueController* QueueController(); |
| 62 | 63 |
| 63 // ChromeGeolocationPermissionContext implementation: | 64 // ChromeGeolocationPermissionContext implementation: |
| 64 // Decide whether the geolocation permission should be granted. | 65 // Decide whether the geolocation permission should be granted. |
| 65 // Calls PermissionDecided if permission can be decided non-interactively, | 66 // Calls PermissionDecided if permission can be decided non-interactively, |
| 66 // or NotifyPermissionSet if permission decided by presenting an | 67 // or NotifyPermissionSet if permission decided by presenting an |
| 67 // infobar to the user. Called on the UI thread. | 68 // infobar to the user. Called on the UI thread. |
| 68 virtual void DecidePermission(content::WebContents* web_contents, | 69 virtual void DecidePermission(content::WebContents* web_contents, |
| 69 const PermissionRequestID& id, | 70 const PermissionRequestID& id, |
| 70 const GURL& requesting_frame, | 71 const GURL& requesting_frame, |
| 72 bool user_gesture, |
| 71 const GURL& embedder, | 73 const GURL& embedder, |
| 72 const std::string& accept_button_label, | 74 const std::string& accept_button_label, |
| 73 base::Callback<void(bool)> callback); | 75 base::Callback<void(bool)> callback); |
| 74 | 76 |
| 75 // Called when permission is granted without interactively asking | 77 // Called when permission is granted without interactively asking |
| 76 // the user. Can be overridden to introduce additional UI flow. | 78 // the user. Can be overridden to introduce additional UI flow. |
| 77 // Should ultimately ensure that NotifyPermissionSet is called. | 79 // Should ultimately ensure that NotifyPermissionSet is called. |
| 78 // Called on the UI thread. | 80 // Called on the UI thread. |
| 79 virtual void PermissionDecided(const PermissionRequestID& id, | 81 virtual void PermissionDecided(const PermissionRequestID& id, |
| 80 const GURL& requesting_frame, | 82 const GURL& requesting_frame, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 99 | 101 |
| 100 // These must only be accessed from the UI thread. | 102 // These must only be accessed from the UI thread. |
| 101 Profile* const profile_; | 103 Profile* const profile_; |
| 102 bool shutting_down_; | 104 bool shutting_down_; |
| 103 scoped_ptr<PermissionQueueController> permission_queue_controller_; | 105 scoped_ptr<PermissionQueueController> permission_queue_controller_; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContext); | 107 DISALLOW_COPY_AND_ASSIGN(ChromeGeolocationPermissionContext); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ | 110 #endif // CHROME_BROWSER_GEOLOCATION_CHROME_GEOLOCATION_PERMISSION_CONTEXT_H_ |
| OLD | NEW |