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

Side by Side Diff: chrome/browser/notifications/desktop_notification_service.h

Issue 955383003: ContentBrowserClient::RequestPermission replies with PermissionStatus instead of bool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android geolocation breakage Created 5 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 (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_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 explicit DesktopNotificationService(Profile* profile); 54 explicit DesktopNotificationService(Profile* profile);
55 ~DesktopNotificationService() override; 55 ~DesktopNotificationService() override;
56 56
57 // Requests Web Notification permission for |requesting_frame|. The |callback| 57 // Requests Web Notification permission for |requesting_frame|. The |callback|
58 // will be invoked after the user has made a decision. 58 // will be invoked after the user has made a decision.
59 void RequestNotificationPermission( 59 void RequestNotificationPermission(
60 content::WebContents* web_contents, 60 content::WebContents* web_contents,
61 const PermissionRequestID& request_id, 61 const PermissionRequestID& request_id,
62 const GURL& requesting_origin, 62 const GURL& requesting_origin,
63 bool user_gesture, 63 bool user_gesture,
64 const base::Callback<void(bool)>& result_callback); 64 const BrowserPermissionCallback& result_callback);
65 65
66 // Returns true if the notifier with |notifier_id| is allowed to send 66 // Returns true if the notifier with |notifier_id| is allowed to send
67 // notifications. 67 // notifications.
68 bool IsNotifierEnabled(const message_center::NotifierId& notifier_id) const; 68 bool IsNotifierEnabled(const message_center::NotifierId& notifier_id) const;
69 69
70 // Updates the availability of the notifier. 70 // Updates the availability of the notifier.
71 void SetNotifierEnabled(const message_center::NotifierId& notifier_id, 71 void SetNotifierEnabled(const message_center::NotifierId& notifier_id,
72 bool enabled); 72 bool enabled);
73 73
74 private: 74 private:
(...skipping 11 matching lines...) Expand all
86 #if defined(ENABLE_EXTENSIONS) 86 #if defined(ENABLE_EXTENSIONS)
87 // extensions::ExtensionRegistryObserver: 87 // extensions::ExtensionRegistryObserver:
88 void OnExtensionUninstalled(content::BrowserContext* browser_context, 88 void OnExtensionUninstalled(content::BrowserContext* browser_context,
89 const extensions::Extension* extension, 89 const extensions::Extension* extension,
90 extensions::UninstallReason reason) override; 90 extensions::UninstallReason reason) override;
91 #endif 91 #endif
92 92
93 // PermissionContextBase: 93 // PermissionContextBase:
94 void UpdateContentSetting(const GURL& requesting_origin, 94 void UpdateContentSetting(const GURL& requesting_origin,
95 const GURL& embedder_origin, 95 const GURL& embedder_origin,
96 bool allowed) override; 96 ContentSetting content_setting) override;
97 97
98 // The profile which owns this object. 98 // The profile which owns this object.
99 Profile* profile_; 99 Profile* profile_;
100 100
101 // Prefs listener for disabled_extension_id. 101 // Prefs listener for disabled_extension_id.
102 StringListPrefMember disabled_extension_id_pref_; 102 StringListPrefMember disabled_extension_id_pref_;
103 103
104 // Prefs listener for disabled_system_component_id. 104 // Prefs listener for disabled_system_component_id.
105 StringListPrefMember disabled_system_component_id_pref_; 105 StringListPrefMember disabled_system_component_id_pref_;
106 106
107 // On-memory data for the availability of extensions. 107 // On-memory data for the availability of extensions.
108 std::set<std::string> disabled_extension_ids_; 108 std::set<std::string> disabled_extension_ids_;
109 109
110 // On-memory data for the availability of system_component. 110 // On-memory data for the availability of system_component.
111 std::set<std::string> disabled_system_component_ids_; 111 std::set<std::string> disabled_system_component_ids_;
112 112
113 #if defined(ENABLE_EXTENSIONS) 113 #if defined(ENABLE_EXTENSIONS)
114 // An observer to listen when extension is uninstalled. 114 // An observer to listen when extension is uninstalled.
115 ScopedObserver<extensions::ExtensionRegistry, 115 ScopedObserver<extensions::ExtensionRegistry,
116 extensions::ExtensionRegistryObserver> 116 extensions::ExtensionRegistryObserver>
117 extension_registry_observer_; 117 extension_registry_observer_;
118 #endif 118 #endif
119 119
120 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); 120 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService);
121 }; 121 };
122 122
123 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ 123 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698