| 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_UI_ZOOM_ZOOM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 double zoom_level, | 107 double zoom_level, |
| 108 const scoped_refptr<const extensions::Extension>& extension); | 108 const scoped_refptr<const extensions::Extension>& extension); |
| 109 | 109 |
| 110 // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). | 110 // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). |
| 111 void SetZoomMode(ZoomMode zoom_mode); | 111 void SetZoomMode(ZoomMode zoom_mode); |
| 112 | 112 |
| 113 // content::WebContentsObserver overrides: | 113 // content::WebContentsObserver overrides: |
| 114 virtual void DidNavigateMainFrame( | 114 virtual void DidNavigateMainFrame( |
| 115 const content::LoadCommittedDetails& details, | 115 const content::LoadCommittedDetails& details, |
| 116 const content::FrameNavigateParams& params) OVERRIDE; | 116 const content::FrameNavigateParams& params) OVERRIDE; |
| 117 virtual void WebContentsDestroyed() OVERRIDE; |
| 117 | 118 |
| 118 private: | 119 private: |
| 119 explicit ZoomController(content::WebContents* web_contents); | 120 explicit ZoomController(content::WebContents* web_contents); |
| 120 friend class content::WebContentsUserData<ZoomController>; | 121 friend class content::WebContentsUserData<ZoomController>; |
| 121 friend class ZoomControllerTest; | 122 friend class ZoomControllerTest; |
| 122 | 123 |
| 123 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); | 124 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| 124 | 125 |
| 125 // Updates the zoom icon and zoom percentage based on current values and | 126 // Updates the zoom icon and zoom percentage based on current values and |
| 126 // notifies the observer if changes have occurred. |host| may be empty, | 127 // notifies the observer if changes have occurred. |host| may be empty, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 150 ObserverList<ZoomObserver> observers_; | 151 ObserverList<ZoomObserver> observers_; |
| 151 | 152 |
| 152 content::BrowserContext* browser_context_; | 153 content::BrowserContext* browser_context_; |
| 153 | 154 |
| 154 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 155 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 155 | 156 |
| 156 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 157 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
| 157 }; | 158 }; |
| 158 | 159 |
| 159 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 160 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| OLD | NEW |