| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Maps hostnames to custom zoom levels. Written on the UI thread and read on | 5 // Maps hostnames to custom zoom levels. Written on the UI thread and read on |
| 6 // any thread. One instance per profile. | 6 // any thread. One instance per profile. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_HOST_ZOOM_MAP_H_ | 8 #ifndef CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
| 9 #define CHROME_BROWSER_HOST_ZOOM_MAP_H_ | 9 #define CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/ref_counted.h" | 17 #include "base/ref_counted.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "chrome/browser/browser_thread.h" | |
| 20 #include "chrome/browser/prefs/pref_change_registrar.h" | 19 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 21 #include "chrome/common/notification_observer.h" | 20 #include "chrome/common/notification_observer.h" |
| 22 #include "chrome/common/notification_registrar.h" | 21 #include "chrome/common/notification_registrar.h" |
| 22 #include "content/browser/browser_thread.h" |
| 23 | 23 |
| 24 class GURL; | 24 class GURL; |
| 25 class PrefService; | 25 class PrefService; |
| 26 class Profile; | 26 class Profile; |
| 27 | 27 |
| 28 // HostZoomMap needs to be deleted on the UI thread because it listens | 28 // HostZoomMap needs to be deleted on the UI thread because it listens |
| 29 // to notifications on there (and holds a NotificationRegistrar). | 29 // to notifications on there (and holds a NotificationRegistrar). |
| 30 class HostZoomMap : | 30 class HostZoomMap : |
| 31 public NotificationObserver, | 31 public NotificationObserver, |
| 32 public base::RefCountedThreadSafe<HostZoomMap, | 32 public base::RefCountedThreadSafe<HostZoomMap, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Whether we are currently updating preferences, this is used to ignore | 117 // Whether we are currently updating preferences, this is used to ignore |
| 118 // notifications from the preference service that we triggered ourself. | 118 // notifications from the preference service that we triggered ourself. |
| 119 bool updating_preferences_; | 119 bool updating_preferences_; |
| 120 | 120 |
| 121 NotificationRegistrar registrar_; | 121 NotificationRegistrar registrar_; |
| 122 PrefChangeRegistrar pref_change_registrar_; | 122 PrefChangeRegistrar pref_change_registrar_; |
| 123 | 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(HostZoomMap); | 124 DISALLOW_COPY_AND_ASSIGN(HostZoomMap); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 #endif // CHROME_BROWSER_HOST_ZOOM_MAP_H_ | 127 #endif // CONTENT_BROWSER_HOST_ZOOM_MAP_H_ |
| OLD | NEW |