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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Sets the zoom level via HostZoomMap (or stores it locally if in manual zoom | 114 // Sets the zoom level via HostZoomMap (or stores it locally if in manual zoom |
115 // mode), and attributes the zoom to |extension|. Returns true on success. | 115 // mode), and attributes the zoom to |extension|. Returns true on success. |
116 bool SetZoomLevelByExtension( | 116 bool SetZoomLevelByExtension( |
117 double zoom_level, | 117 double zoom_level, |
118 const scoped_refptr<const extensions::Extension>& extension); | 118 const scoped_refptr<const extensions::Extension>& extension); |
119 | 119 |
120 // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). | 120 // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). |
121 void SetZoomMode(ZoomMode zoom_mode); | 121 void SetZoomMode(ZoomMode zoom_mode); |
122 | 122 |
123 // content::WebContentsObserver overrides: | 123 // content::WebContentsObserver overrides: |
| 124 virtual void DidCommitProvisionalLoadForFrame( |
| 125 content::RenderFrameHost* render_frame_host, |
| 126 const GURL& url, |
| 127 bool url_is_unreachable, |
| 128 ui::PageTransition transition_type) OVERRIDE; |
124 virtual void DidNavigateMainFrame( | 129 virtual void DidNavigateMainFrame( |
125 const content::LoadCommittedDetails& details, | 130 const content::LoadCommittedDetails& details, |
126 const content::FrameNavigateParams& params) OVERRIDE; | 131 const content::FrameNavigateParams& params) OVERRIDE; |
127 virtual void WebContentsDestroyed() OVERRIDE; | 132 virtual void WebContentsDestroyed() OVERRIDE; |
128 | 133 |
129 protected: | 134 protected: |
130 // Protected for testing. | 135 // Protected for testing. |
131 explicit ZoomController(content::WebContents* web_contents); | 136 explicit ZoomController(content::WebContents* web_contents); |
132 | 137 |
133 private: | 138 private: |
(...skipping 22 matching lines...) Expand all Loading... |
156 // Keeps track of the extension (if any) that initiated the last zoom change | 161 // Keeps track of the extension (if any) that initiated the last zoom change |
157 // that took effect. | 162 // that took effect. |
158 scoped_refptr<const extensions::Extension> last_extension_; | 163 scoped_refptr<const extensions::Extension> last_extension_; |
159 | 164 |
160 // Observer receiving notifications on state changes. | 165 // Observer receiving notifications on state changes. |
161 ObserverList<ZoomObserver> observers_; | 166 ObserverList<ZoomObserver> observers_; |
162 | 167 |
163 content::BrowserContext* browser_context_; | 168 content::BrowserContext* browser_context_; |
164 | 169 |
165 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; | 170 scoped_ptr<content::HostZoomMap::Subscription> zoom_subscription_; |
| 171 bool is_error_page_; |
166 | 172 |
167 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 173 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
168 }; | 174 }; |
169 | 175 |
170 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 176 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
OLD | NEW |