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_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 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // blocked local shared objects like cookies, local storage, ... . | 223 // blocked local shared objects like cookies, local storage, ... . |
224 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { | 224 const LocalSharedObjectsContainer& blocked_local_shared_objects() const { |
225 return blocked_local_shared_objects_; | 225 return blocked_local_shared_objects_; |
226 } | 226 } |
227 | 227 |
228 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } | 228 bool load_plugins_link_enabled() { return load_plugins_link_enabled_; } |
229 void set_load_plugins_link_enabled(bool enabled) { | 229 void set_load_plugins_link_enabled(bool enabled) { |
230 load_plugins_link_enabled_ = enabled; | 230 load_plugins_link_enabled_ = enabled; |
231 } | 231 } |
232 | 232 |
| 233 // Called to indicate whether access to the Pepper broker was allowed or |
| 234 // blocked. |
| 235 void SetPepperBrokerAllowed(bool allowed); |
| 236 |
233 // content::WebContentsObserver overrides. | 237 // content::WebContentsObserver overrides. |
234 virtual void RenderViewForInterstitialPageCreated( | 238 virtual void RenderViewForInterstitialPageCreated( |
235 content::RenderViewHost* render_view_host) OVERRIDE; | 239 content::RenderViewHost* render_view_host) OVERRIDE; |
236 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 240 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
237 virtual void DidNavigateMainFrame( | 241 virtual void DidNavigateMainFrame( |
238 const content::LoadCommittedDetails& details, | 242 const content::LoadCommittedDetails& details, |
239 const content::FrameNavigateParams& params) OVERRIDE; | 243 const content::FrameNavigateParams& params) OVERRIDE; |
240 virtual void DidStartProvisionalLoadForFrame( | 244 virtual void DidStartProvisionalLoadForFrame( |
241 int64 frame_id, | 245 int64 frame_id, |
242 int64 parent_frame_id, | 246 int64 parent_frame_id, |
243 bool is_main_frame, | 247 bool is_main_frame, |
244 const GURL& validated_url, | 248 const GURL& validated_url, |
245 bool is_error_page, | 249 bool is_error_page, |
246 content::RenderViewHost* render_view_host) OVERRIDE; | 250 content::RenderViewHost* render_view_host) OVERRIDE; |
247 virtual void AppCacheAccessed(const GURL& manifest_url, | 251 virtual void AppCacheAccessed(const GURL& manifest_url, |
248 bool blocked_by_policy) OVERRIDE; | 252 bool blocked_by_policy) OVERRIDE; |
249 | 253 |
250 // Message handlers. Public for testing. | 254 // Message handlers. Public for testing. |
251 void OnContentBlocked(ContentSettingsType type, | 255 void OnContentBlocked(ContentSettingsType type, |
252 const std::string& resource_identifier); | 256 const std::string& resource_identifier); |
| 257 void OnContentAccessed(ContentSettingsType type); |
253 | 258 |
254 // These methods are invoked on the UI thread by the static functions above. | 259 // These methods are invoked on the UI thread by the static functions above. |
255 // Public for testing. | 260 // Public for testing. |
256 void OnCookiesRead(const GURL& url, | 261 void OnCookiesRead(const GURL& url, |
257 const GURL& first_party_url, | 262 const GURL& first_party_url, |
258 const net::CookieList& cookie_list, | 263 const net::CookieList& cookie_list, |
259 bool blocked_by_policy); | 264 bool blocked_by_policy); |
260 void OnCookieChanged(const GURL& url, | 265 void OnCookieChanged(const GURL& url, |
261 const GURL& first_party_url, | 266 const GURL& first_party_url, |
262 const std::string& cookie_line, | 267 const std::string& cookie_line, |
(...skipping 21 matching lines...) Expand all Loading... |
284 // Removes the given |SiteDataObserver|. | 289 // Removes the given |SiteDataObserver|. |
285 void RemoveSiteDataObserver(SiteDataObserver* observer); | 290 void RemoveSiteDataObserver(SiteDataObserver* observer); |
286 | 291 |
287 private: | 292 private: |
288 explicit TabSpecificContentSettings(content::WebContents* tab); | 293 explicit TabSpecificContentSettings(content::WebContents* tab); |
289 friend class content::WebContentsUserData<TabSpecificContentSettings>; | 294 friend class content::WebContentsUserData<TabSpecificContentSettings>; |
290 | 295 |
291 void AddBlockedResource(ContentSettingsType content_type, | 296 void AddBlockedResource(ContentSettingsType content_type, |
292 const std::string& resource_identifier); | 297 const std::string& resource_identifier); |
293 | 298 |
294 void OnContentAccessed(ContentSettingsType type); | |
295 | |
296 // content::NotificationObserver implementation. | 299 // content::NotificationObserver implementation. |
297 virtual void Observe(int type, | 300 virtual void Observe(int type, |
298 const content::NotificationSource& source, | 301 const content::NotificationSource& source, |
299 const content::NotificationDetails& details) OVERRIDE; | 302 const content::NotificationDetails& details) OVERRIDE; |
300 | 303 |
301 // Notifies all registered |SiteDataObserver|s. | 304 // Notifies all registered |SiteDataObserver|s. |
302 void NotifySiteDataObservers(); | 305 void NotifySiteDataObservers(); |
303 | 306 |
304 // All currently registered |SiteDataObserver|s. | 307 // All currently registered |SiteDataObserver|s. |
305 ObserverList<SiteDataObserver> observer_list_; | 308 ObserverList<SiteDataObserver> observer_list_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 348 |
346 // Stores whether the user can load blocked plugins on this page. | 349 // Stores whether the user can load blocked plugins on this page. |
347 bool load_plugins_link_enabled_; | 350 bool load_plugins_link_enabled_; |
348 | 351 |
349 content::NotificationRegistrar registrar_; | 352 content::NotificationRegistrar registrar_; |
350 | 353 |
351 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 354 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
352 }; | 355 }; |
353 | 356 |
354 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 357 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
OLD | NEW |