 Chromium Code Reviews
 Chromium Code Reviews Issue 393133002:
  Migrate HostZoomMap to live in StoragePartition.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 393133002:
  Migrate HostZoomMap to live in StoragePartition.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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 // This class gathers state related to a single user profile. | 5 // This class gathers state related to a single user profile. | 
| 6 | 6 | 
| 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ | 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_H_ | 
| 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ | 8 #define CHROME_BROWSER_PROFILES_PROFILE_H_ | 
| 9 | 9 | 
| 10 #include <string> | 10 #include <string> | 
| 11 | 11 | 
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" | 
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" | 
| 14 #include "base/logging.h" | 14 #include "base/logging.h" | 
| 15 #include "components/domain_reliability/clear_mode.h" | 15 #include "components/domain_reliability/clear_mode.h" | 
| 16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" | 
| 17 #include "content/public/browser/content_browser_client.h" | 17 #include "content/public/browser/content_browser_client.h" | 
| 18 #include "content/public/browser/host_zoom_map.h" | |
| 18 | 19 | 
| 19 class ChromeAppCacheService; | 20 class ChromeAppCacheService; | 
| 20 class DevToolsNetworkController; | 21 class DevToolsNetworkController; | 
| 21 class ExtensionSpecialStoragePolicy; | 22 class ExtensionSpecialStoragePolicy; | 
| 22 class FaviconService; | 23 class FaviconService; | 
| 23 class HostContentSettingsMap; | 24 class HostContentSettingsMap; | 
| 24 class PrefProxyConfigTracker; | 25 class PrefProxyConfigTracker; | 
| 25 class PrefService; | 26 class PrefService; | 
| 26 class PromoCounter; | 27 class PromoCounter; | 
| 27 class ProtocolHandlerRegistry; | 28 class ProtocolHandlerRegistry; | 
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 388 bool IsSyncAccessible(); | 389 bool IsSyncAccessible(); | 
| 389 | 390 | 
| 390 // Send NOTIFICATION_PROFILE_DESTROYED for this Profile, if it has not | 391 // Send NOTIFICATION_PROFILE_DESTROYED for this Profile, if it has not | 
| 391 // already been sent. It is necessary because most Profiles are destroyed by | 392 // already been sent. It is necessary because most Profiles are destroyed by | 
| 392 // ProfileDestroyer, but in tests, some are not. | 393 // ProfileDestroyer, but in tests, some are not. | 
| 393 void MaybeSendDestroyedNotification(); | 394 void MaybeSendDestroyedNotification(); | 
| 394 | 395 | 
| 395 // Creates an OffTheRecordProfile which points to this Profile. | 396 // Creates an OffTheRecordProfile which points to this Profile. | 
| 396 Profile* CreateOffTheRecordProfile(); | 397 Profile* CreateOffTheRecordProfile(); | 
| 397 | 398 | 
| 399 // Convenience method to retrieve the default zoom level for the default | |
| 400 // storage partition. | |
| 401 double GetDefaultZoomLevel(); | |
| 
Fady Samuel
2014/11/03 22:11:11
nit: Can this be a const method?
 
wjmaclean
2014/11/04 19:34:25
Sadly, no, as the profile has to pass |this| to Ge
 | |
| 402 | |
| 403 protected: | |
| 404 // Allows a profile to track changes in zoom levels in another profile. | |
| 405 // This function, along with TrackZoomLevelChanged(), are placed in Profile | |
| 406 // to facilitate testing with TestingProfile. | |
| 407 void TrackZoomLevelsFromParent(Profile* parent); | |
| 408 | |
| 398 private: | 409 private: | 
| 410 // Callback function for tracking parent's zoom level changes. | |
| 411 void TrackZoomLevelChanged( | |
| 412 const content::HostZoomMap::ZoomLevelChange& change); | |
| 413 | |
| 414 scoped_ptr<content::HostZoomMap::Subscription> track_zoom_subscription_; | |
| 415 | |
| 399 bool restored_last_session_; | 416 bool restored_last_session_; | 
| 400 | 417 | 
| 401 // Used to prevent the notification that this Profile is destroyed from | 418 // Used to prevent the notification that this Profile is destroyed from | 
| 402 // being sent twice. | 419 // being sent twice. | 
| 403 bool sent_destroyed_notification_; | 420 bool sent_destroyed_notification_; | 
| 404 | 421 | 
| 405 // Accessibility events will only be propagated when the pause | 422 // Accessibility events will only be propagated when the pause | 
| 406 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents | 423 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents | 
| 407 // increment and decrement the level, respectively, rather than set it to | 424 // increment and decrement the level, respectively, rather than set it to | 
| 408 // true or false, so that calls can be nested. | 425 // true or false, so that calls can be nested. | 
| 409 int accessibility_pause_level_; | 426 int accessibility_pause_level_; | 
| 410 | 427 | 
| 411 DISALLOW_COPY_AND_ASSIGN(Profile); | 428 DISALLOW_COPY_AND_ASSIGN(Profile); | 
| 412 }; | 429 }; | 
| 413 | 430 | 
| 414 // The comparator for profile pointers as key in a map. | 431 // The comparator for profile pointers as key in a map. | 
| 415 struct ProfileCompare { | 432 struct ProfileCompare { | 
| 416 bool operator()(Profile* a, Profile* b) const; | 433 bool operator()(Profile* a, Profile* b) const; | 
| 417 }; | 434 }; | 
| 418 | 435 | 
| 419 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 436 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 
| OLD | NEW |