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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 const ContentSettingsUsagesState& geolocation_usages_state() const { | 258 const ContentSettingsUsagesState& geolocation_usages_state() const { |
259 return geolocation_usages_state_; | 259 return geolocation_usages_state_; |
260 } | 260 } |
261 | 261 |
262 // Returns the ContentSettingsUsageState that controls the MIDI usage on | 262 // Returns the ContentSettingsUsageState that controls the MIDI usage on |
263 // this page. | 263 // this page. |
264 const ContentSettingsUsagesState& midi_usages_state() const { | 264 const ContentSettingsUsagesState& midi_usages_state() const { |
265 return midi_usages_state_; | 265 return midi_usages_state_; |
266 } | 266 } |
267 | 267 |
| 268 /* |
| 269 // Returns the ContentSettingsUsageState that controls the Sensors usage on |
| 270 // this page. |
| 271 const ContentSettingsUsagesState& sensors_usages_state() const { |
| 272 return sensors_usages_state_; |
| 273 } |
| 274 */ |
| 275 |
268 // Call to indicate that there is a protocol handler pending user approval. | 276 // Call to indicate that there is a protocol handler pending user approval. |
269 void set_pending_protocol_handler(const ProtocolHandler& handler) { | 277 void set_pending_protocol_handler(const ProtocolHandler& handler) { |
270 pending_protocol_handler_ = handler; | 278 pending_protocol_handler_ = handler; |
271 } | 279 } |
272 | 280 |
273 const ProtocolHandler& pending_protocol_handler() const { | 281 const ProtocolHandler& pending_protocol_handler() const { |
274 return pending_protocol_handler_; | 282 return pending_protocol_handler_; |
275 } | 283 } |
276 | 284 |
277 void ClearPendingProtocolHandler() { | 285 void ClearPendingProtocolHandler() { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 MicrophoneCameraState new_microphone_camera_state, | 374 MicrophoneCameraState new_microphone_camera_state, |
367 const std::string& media_stream_selected_audio_device, | 375 const std::string& media_stream_selected_audio_device, |
368 const std::string& media_stream_selected_video_device, | 376 const std::string& media_stream_selected_video_device, |
369 const std::string& media_stream_requested_audio_device, | 377 const std::string& media_stream_requested_audio_device, |
370 const std::string& media_stream_requested_video_device); | 378 const std::string& media_stream_requested_video_device); |
371 | 379 |
372 // There methods are called to update the status about MIDI access. | 380 // There methods are called to update the status about MIDI access. |
373 void OnMidiSysExAccessed(const GURL& reqesting_origin); | 381 void OnMidiSysExAccessed(const GURL& reqesting_origin); |
374 void OnMidiSysExAccessBlocked(const GURL& requesting_origin); | 382 void OnMidiSysExAccessBlocked(const GURL& requesting_origin); |
375 | 383 |
| 384 // There methods are called to update the status about Sensor access. |
| 385 void OnSensorAccessed(const GURL& reqesting_origin); |
| 386 void OnSensorAccessBlocked(const GURL& requesting_origin); |
| 387 |
376 // Adds the given |SiteDataObserver|. The |observer| is notified when a | 388 // Adds the given |SiteDataObserver|. The |observer| is notified when a |
377 // locale shared object, like for example a cookie, is accessed. | 389 // locale shared object, like for example a cookie, is accessed. |
378 void AddSiteDataObserver(SiteDataObserver* observer); | 390 void AddSiteDataObserver(SiteDataObserver* observer); |
379 | 391 |
380 // Removes the given |SiteDataObserver|. | 392 // Removes the given |SiteDataObserver|. |
381 void RemoveSiteDataObserver(SiteDataObserver* observer); | 393 void RemoveSiteDataObserver(SiteDataObserver* observer); |
382 | 394 |
383 // Block all content. Used for testing content setting bubbles. | 395 // Block all content. Used for testing content setting bubbles. |
384 void BlockAllContentForTesting(); | 396 void BlockAllContentForTesting(); |
385 | 397 |
(...skipping 22 matching lines...) Expand all Loading... |
408 | 420 |
409 // Notifies all registered |SiteDataObserver|s. | 421 // Notifies all registered |SiteDataObserver|s. |
410 void NotifySiteDataObservers(); | 422 void NotifySiteDataObservers(); |
411 | 423 |
412 // Clears the Geolocation settings. | 424 // Clears the Geolocation settings. |
413 void ClearGeolocationContentSettings(); | 425 void ClearGeolocationContentSettings(); |
414 | 426 |
415 // Clears the MIDI settings. | 427 // Clears the MIDI settings. |
416 void ClearMidiContentSettings(); | 428 void ClearMidiContentSettings(); |
417 | 429 |
| 430 // TODO(riju): when UMA is ready. |
| 431 // Clears the Sensor settings. |
| 432 // void ClearSensorContentSettings(); |
| 433 |
418 // Updates Geolocation settings on navigation. | 434 // Updates Geolocation settings on navigation. |
419 void GeolocationDidNavigate(content::NavigationHandle* navigation_handle); | 435 void GeolocationDidNavigate(content::NavigationHandle* navigation_handle); |
420 | 436 |
421 // Updates MIDI settings on navigation. | 437 // Updates MIDI settings on navigation. |
422 void MidiDidNavigate(content::NavigationHandle* navigation_handle); | 438 void MidiDidNavigate(content::NavigationHandle* navigation_handle); |
423 | 439 |
| 440 // TODO(riju): when UMA is ready. |
| 441 // Updates Sensor settings on navigation. |
| 442 // void SensorDidNavigate(content::NavigationHandle* navigation_handle); |
| 443 |
424 // All currently registered |SiteDataObserver|s. | 444 // All currently registered |SiteDataObserver|s. |
425 base::ObserverList<SiteDataObserver> observer_list_; | 445 base::ObserverList<SiteDataObserver> observer_list_; |
426 | 446 |
427 struct ContentSettingsStatus { | 447 struct ContentSettingsStatus { |
428 bool blocked; | 448 bool blocked; |
429 bool blockage_indicated_to_user; | 449 bool blockage_indicated_to_user; |
430 bool allowed; | 450 bool allowed; |
431 }; | 451 }; |
432 // Stores which content setting types actually have blocked content. | 452 // Stores which content setting types actually have blocked content. |
433 std::map<ContentSettingsType, ContentSettingsStatus> content_settings_status_; | 453 std::map<ContentSettingsType, ContentSettingsStatus> content_settings_status_; |
434 | 454 |
435 // Stores the blocked/allowed cookies. | 455 // Stores the blocked/allowed cookies. |
436 LocalSharedObjectsContainer allowed_local_shared_objects_; | 456 LocalSharedObjectsContainer allowed_local_shared_objects_; |
437 LocalSharedObjectsContainer blocked_local_shared_objects_; | 457 LocalSharedObjectsContainer blocked_local_shared_objects_; |
438 | 458 |
439 // Manages information about Geolocation API usage in this page. | 459 // Manages information about Geolocation API usage in this page. |
440 ContentSettingsUsagesState geolocation_usages_state_; | 460 ContentSettingsUsagesState geolocation_usages_state_; |
441 | 461 |
442 // Manages information about MIDI usages in this page. | 462 // Manages information about MIDI usages in this page. |
443 ContentSettingsUsagesState midi_usages_state_; | 463 ContentSettingsUsagesState midi_usages_state_; |
444 | 464 |
| 465 // Manages information about sensors usages in this page. |
| 466 // ContentSettingsUsagesState sensors_usages_state_; |
| 467 |
445 // The pending protocol handler, if any. This can be set if | 468 // The pending protocol handler, if any. This can be set if |
446 // registerProtocolHandler was invoked without user gesture. | 469 // registerProtocolHandler was invoked without user gesture. |
447 // The |IsEmpty| method will be true if no protocol handler is | 470 // The |IsEmpty| method will be true if no protocol handler is |
448 // pending registration. | 471 // pending registration. |
449 ProtocolHandler pending_protocol_handler_; | 472 ProtocolHandler pending_protocol_handler_; |
450 | 473 |
451 // The previous protocol handler to be replaced by | 474 // The previous protocol handler to be replaced by |
452 // the pending_protocol_handler_, if there is one. Empty if | 475 // the pending_protocol_handler_, if there is one. Empty if |
453 // there is no handler which would be replaced. | 476 // there is no handler which would be replaced. |
454 ProtocolHandler previous_protocol_handler_; | 477 ProtocolHandler previous_protocol_handler_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // Holds the previous committed url during a navigation. | 509 // Holds the previous committed url during a navigation. |
487 GURL previous_url_; | 510 GURL previous_url_; |
488 | 511 |
489 // Observer to watch for content settings changed. | 512 // Observer to watch for content settings changed. |
490 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 513 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
491 | 514 |
492 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); | 515 DISALLOW_COPY_AND_ASSIGN(TabSpecificContentSettings); |
493 }; | 516 }; |
494 | 517 |
495 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ | 518 #endif // CHROME_BROWSER_CONTENT_SETTINGS_TAB_SPECIFIC_CONTENT_SETTINGS_H_ |
OLD | NEW |