| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 double zoom_level, | 100 double zoom_level, |
| 101 const scoped_refptr<const extensions::Extension>& extension); | 101 const scoped_refptr<const extensions::Extension>& extension); |
| 102 | 102 |
| 103 // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). | 103 // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). |
| 104 void SetZoomMode(ZoomMode zoom_mode); | 104 void SetZoomMode(ZoomMode zoom_mode); |
| 105 | 105 |
| 106 // content::WebContentsObserver overrides: | 106 // content::WebContentsObserver overrides: |
| 107 virtual void DidNavigateMainFrame( | 107 virtual void DidNavigateMainFrame( |
| 108 const content::LoadCommittedDetails& details, | 108 const content::LoadCommittedDetails& details, |
| 109 const content::FrameNavigateParams& params) OVERRIDE; | 109 const content::FrameNavigateParams& params) OVERRIDE; |
| 110 virtual void WebContentsDestroyed() OVERRIDE; |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 explicit ZoomController(content::WebContents* web_contents); | 113 explicit ZoomController(content::WebContents* web_contents); |
| 113 friend class content::WebContentsUserData<ZoomController>; | 114 friend class content::WebContentsUserData<ZoomController>; |
| 114 friend class ZoomControllerTest; | 115 friend class ZoomControllerTest; |
| 115 | 116 |
| 116 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); | 117 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| 117 | 118 |
| 118 // Updates the zoom icon and zoom percentage based on current values and | 119 // Updates the zoom icon and zoom percentage based on current values and |
| 119 // notifies the observer if changes have occurred. |host| may be empty, | 120 // notifies the observer if changes have occurred. |host| may be empty, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 140 ObserverList<ZoomObserver> observers_; | 141 ObserverList<ZoomObserver> observers_; |
| 141 | 142 |
| 142 content::BrowserContext* browser_context_; | 143 content::BrowserContext* browser_context_; |
| 143 | 144 |
| 144 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 145 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 145 | 146 |
| 146 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 147 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 150 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
| OLD | NEW |