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

Side by Side Diff: chrome/browser/content_settings/tab_specific_content_settings.h

Issue 10584042: Bring up a content settings icon for ungestured registerProtocolHandler call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make windows happy Created 8 years, 6 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 | Annotate | Revision Log
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_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 6 #define CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "chrome/browser/content_settings/local_shared_objects_container.h" 16 #include "chrome/browser/content_settings/local_shared_objects_container.h"
17 #include "chrome/browser/geolocation/geolocation_settings_state.h" 17 #include "chrome/browser/geolocation/geolocation_settings_state.h"
18 #include "chrome/common/content_settings.h" 18 #include "chrome/common/content_settings.h"
19 #include "chrome/common/content_settings_types.h" 19 #include "chrome/common/content_settings_types.h"
20 #include "chrome/common/custom_handlers/protocol_handler.h"
20 #include "content/public/browser/notification_observer.h" 21 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h" 22 #include "content/public/browser/notification_registrar.h"
22 #include "content/public/browser/web_contents_observer.h" 23 #include "content/public/browser/web_contents_observer.h"
23 24
24 class CookiesTreeModel; 25 class CookiesTreeModel;
25 class Profile; 26 class Profile;
26 27
27 namespace content { 28 namespace content {
28 class RenderViewHost; 29 class RenderViewHost;
29 } 30 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 163
163 const std::set<std::string>& BlockedResourcesForType( 164 const std::set<std::string>& BlockedResourcesForType(
164 ContentSettingsType content_type) const; 165 ContentSettingsType content_type) const;
165 166
166 // Returns the GeolocationSettingsState that controls the 167 // Returns the GeolocationSettingsState that controls the
167 // geolocation API usage on this page. 168 // geolocation API usage on this page.
168 const GeolocationSettingsState& geolocation_settings_state() const { 169 const GeolocationSettingsState& geolocation_settings_state() const {
169 return geolocation_settings_state_; 170 return geolocation_settings_state_;
170 } 171 }
171 172
173 // Call to indicate that there is a protocol handler pending user approval.
174 void SetPendingProtocolHandler(const ProtocolHandler& handler) {
Bernhard Bauer 2012/06/25 16:52:20 Trivial setters/getters should be named unix_hacke
Greg Billock 2012/06/26 19:17:04 Done.
175 pending_protocol_handler_ = handler;
176 }
177
178 const ProtocolHandler& GetPendingProtocolHandler() const {
179 return pending_protocol_handler_;
180 }
181
182 void ClearPendingProtocolHandler() {
183 pending_protocol_handler_ = ProtocolHandler::EmptyProtocolHandler();
184 }
185
186
187 // Sets the previous protocol handler which will be replaced by the
188 // pending protocol handler.
189 void SetPreviousProtocolHandler(const ProtocolHandler& handler) {
190 previous_protocol_handler_ = handler;
191 }
192
193 const ProtocolHandler& GetPreviousProtocolHandler() const {
194 return previous_protocol_handler_;
195 }
196
197 // Set whether the setting for the pending handler is DEFAULT (ignore),
198 // ALLOW, or DENY.
199 void SetPendingProtocolHandlerSetting(ContentSetting setting) {
200 pending_protocol_handler_setting_ = setting;
201 }
202
203 ContentSetting GetPendingProtocolHandlerSetting() const {
204 return pending_protocol_handler_setting_;
205 }
206
207
172 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all 208 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all
173 // allowed local shared objects like cookies, local storage, ... . 209 // allowed local shared objects like cookies, local storage, ... .
174 const LocalSharedObjectsContainer& allowed_local_shared_objects() const { 210 const LocalSharedObjectsContainer& allowed_local_shared_objects() const {
175 return allowed_local_shared_objects_; 211 return allowed_local_shared_objects_;
176 } 212 }
177 213
178 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all 214 // Returns a pointer to the |LocalSharedObjectsContainer| that contains all
179 // blocked local shared objects like cookies, local storage, ... . 215 // blocked local shared objects like cookies, local storage, ... .
180 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { 216 const LocalSharedObjectsContainer& blocked_local_shared_objects() const {
181 return blocked_local_shared_objects_; 217 return blocked_local_shared_objects_;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // The profile of the tab. 309 // The profile of the tab.
274 Profile* profile_; 310 Profile* profile_;
275 311
276 // Stores the blocked/allowed cookies. 312 // Stores the blocked/allowed cookies.
277 LocalSharedObjectsContainer allowed_local_shared_objects_; 313 LocalSharedObjectsContainer allowed_local_shared_objects_;
278 LocalSharedObjectsContainer blocked_local_shared_objects_; 314 LocalSharedObjectsContainer blocked_local_shared_objects_;
279 315
280 // Manages information about Geolocation API usage in this page. 316 // Manages information about Geolocation API usage in this page.
281 GeolocationSettingsState geolocation_settings_state_; 317 GeolocationSettingsState geolocation_settings_state_;
282 318
319 // The pending protocol handler, if any. This can be set if
320 // registerProtocolHandler was invoked without user gesture.
321 // The |IsEmpty| method will be true if no protocol handler is
322 // pending registration.
323 ProtocolHandler pending_protocol_handler_;
324
325 // The previous protocol handler to be replaced by
326 // the pending_protocol_handler_, if there is one. Empty if
327 // there is no handler which would be replaced.
328 ProtocolHandler previous_protocol_handler_;
329
330 // The setting on the pending protocol handler registration.
Bernhard Bauer 2012/06/25 16:52:20 I think this is only interesting if we open the bu
Greg Billock 2012/06/26 19:17:04 You got it. Added clarification. On 2012/06/25 16
331 ContentSetting pending_protocol_handler_setting_;
332
283 // Stores whether the user can load blocked plugins on this page. 333 // Stores whether the user can load blocked plugins on this page.
284 bool load_plugins_link_enabled_; 334 bool load_plugins_link_enabled_;
285 335
286 content::NotificationRegistrar registrar_; 336 content::NotificationRegistrar registrar_;
287 337
288 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); 338 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings);
289 }; 339 };
290 340
291 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ 341 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698