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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 bool IsSyncAccessible(); | 378 bool IsSyncAccessible(); |
378 | 379 |
379 // Send NOTIFICATION_PROFILE_DESTROYED for this Profile, if it has not | 380 // Send NOTIFICATION_PROFILE_DESTROYED for this Profile, if it has not |
380 // already been sent. It is necessary because most Profiles are destroyed by | 381 // already been sent. It is necessary because most Profiles are destroyed by |
381 // ProfileDestroyer, but in tests, some are not. | 382 // ProfileDestroyer, but in tests, some are not. |
382 void MaybeSendDestroyedNotification(); | 383 void MaybeSendDestroyedNotification(); |
383 | 384 |
384 // Creates an OffTheRecordProfile which points to this Profile. | 385 // Creates an OffTheRecordProfile which points to this Profile. |
385 Profile* CreateOffTheRecordProfile(); | 386 Profile* CreateOffTheRecordProfile(); |
386 | 387 |
| 388 protected: |
| 389 // Allows a profile to track changes in zoom levels in another profile. |
| 390 // This function, along with TrackZoomLevelChanged(), are placed in Profile |
| 391 // to facilitate testing with TestingProfile. |
| 392 void TrackZoomLevelsFromParent(Profile* parent); |
| 393 |
387 private: | 394 private: |
| 395 // Callback function for tracking parent's zoom level changes. |
| 396 void TrackZoomLevelChanged( |
| 397 const content::HostZoomMap::ZoomLevelChange& change); |
| 398 |
| 399 scoped_ptr<content::HostZoomMap::Subscription> track_zoom_subscription_; |
| 400 |
388 bool restored_last_session_; | 401 bool restored_last_session_; |
389 | 402 |
390 // Used to prevent the notification that this Profile is destroyed from | 403 // Used to prevent the notification that this Profile is destroyed from |
391 // being sent twice. | 404 // being sent twice. |
392 bool sent_destroyed_notification_; | 405 bool sent_destroyed_notification_; |
393 | 406 |
394 // Accessibility events will only be propagated when the pause | 407 // Accessibility events will only be propagated when the pause |
395 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents | 408 // level is zero. PauseAccessibilityEvents and ResumeAccessibilityEvents |
396 // increment and decrement the level, respectively, rather than set it to | 409 // increment and decrement the level, respectively, rather than set it to |
397 // true or false, so that calls can be nested. | 410 // true or false, so that calls can be nested. |
(...skipping 14 matching lines...) Expand all Loading... |
412 struct hash<Profile*> { | 425 struct hash<Profile*> { |
413 std::size_t operator()(Profile* const& p) const { | 426 std::size_t operator()(Profile* const& p) const { |
414 return reinterpret_cast<std::size_t>(p); | 427 return reinterpret_cast<std::size_t>(p); |
415 } | 428 } |
416 }; | 429 }; |
417 | 430 |
418 } // namespace BASE_HASH_NAMESPACE | 431 } // namespace BASE_HASH_NAMESPACE |
419 #endif | 432 #endif |
420 | 433 |
421 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ | 434 #endif // CHROME_BROWSER_PROFILES_PROFILE_H_ |
OLD | NEW |