| 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 COMPONENTS_UI_ZOOM_ZOOM_CONTROLLER_H_ | 5 #ifndef COMPONENTS_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| 6 #define COMPONENTS_UI_ZOOM_ZOOM_CONTROLLER_H_ | 6 #define COMPONENTS_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 13 #include "components/prefs/pref_member.h" | 14 #include "components/prefs/pref_member.h" |
| 14 #include "content/public/browser/host_zoom_map.h" | 15 #include "content/public/browser/host_zoom_map.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "content/public/browser/web_contents_user_data.h" | 17 #include "content/public/browser/web_contents_user_data.h" |
| 17 | 18 |
| 18 class ZoomControllerTest; | 19 class ZoomControllerTest; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 class WebContents; | 22 class WebContents; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 174 |
| 174 // True if changes to zoom level can trigger the zoom notification bubble. | 175 // True if changes to zoom level can trigger the zoom notification bubble. |
| 175 bool can_show_bubble_; | 176 bool can_show_bubble_; |
| 176 | 177 |
| 177 // The current zoom mode. | 178 // The current zoom mode. |
| 178 ZoomMode zoom_mode_; | 179 ZoomMode zoom_mode_; |
| 179 | 180 |
| 180 // Current zoom level. | 181 // Current zoom level. |
| 181 double zoom_level_; | 182 double zoom_level_; |
| 182 | 183 |
| 183 scoped_ptr<ZoomChangedEventData> event_data_; | 184 std::unique_ptr<ZoomChangedEventData> event_data_; |
| 184 | 185 |
| 185 // Keeps track of the extension (if any) that initiated the last zoom change | 186 // Keeps track of the extension (if any) that initiated the last zoom change |
| 186 // that took effect. | 187 // that took effect. |
| 187 scoped_refptr<const ZoomRequestClient> last_client_; | 188 scoped_refptr<const ZoomRequestClient> last_client_; |
| 188 | 189 |
| 189 // Observer receiving notifications on state changes. | 190 // Observer receiving notifications on state changes. |
| 190 base::ObserverList<ZoomObserver> observers_; | 191 base::ObserverList<ZoomObserver> observers_; |
| 191 | 192 |
| 192 content::BrowserContext* browser_context_; | 193 content::BrowserContext* browser_context_; |
| 193 // Keep track of the HostZoomMap we're currently subscribed to. | 194 // Keep track of the HostZoomMap we're currently subscribed to. |
| 194 content::HostZoomMap* host_zoom_map_; | 195 content::HostZoomMap* host_zoom_map_; |
| 195 | 196 |
| 196 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 197 std::unique_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 197 | 198 |
| 198 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 199 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
| 199 }; | 200 }; |
| 200 | 201 |
| 201 } // namespace ui_zoom | 202 } // namespace ui_zoom |
| 202 | 203 |
| 203 #endif // COMPONENTS_UI_ZOOM_ZOOM_CONTROLLER_H_ | 204 #endif // COMPONENTS_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| OLD | NEW |