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 "chrome/browser/api/prefs/pref_member.h" | 10 #include "chrome/browser/api/prefs/pref_member.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Convenience method to quickly check if the tab's at default zoom. | 31 // Convenience method to quickly check if the tab's at default zoom. |
32 bool IsAtDefaultZoom() const; | 32 bool IsAtDefaultZoom() const; |
33 | 33 |
34 // Returns which image should be loaded for the current zoom level. | 34 // Returns which image should be loaded for the current zoom level. |
35 int GetResourceForZoomLevel() const; | 35 int GetResourceForZoomLevel() const; |
36 | 36 |
37 void set_observer(ZoomObserver* observer) { observer_ = observer; } | 37 void set_observer(ZoomObserver* observer) { observer_ = observer; } |
38 | 38 |
39 private: | 39 private: |
40 explicit ZoomController(content::WebContents* web_contents); | 40 explicit ZoomController(content::WebContents* web_contents); |
41 static int kUserDataKey; | |
42 friend class WebContentsUserData<ZoomController>; | 41 friend class WebContentsUserData<ZoomController>; |
43 | 42 |
44 // content::WebContentsObserver overrides: | 43 // content::WebContentsObserver overrides: |
45 virtual void DidNavigateMainFrame( | 44 virtual void DidNavigateMainFrame( |
46 const content::LoadCommittedDetails& details, | 45 const content::LoadCommittedDetails& details, |
47 const content::FrameNavigateParams& params) OVERRIDE; | 46 const content::FrameNavigateParams& params) OVERRIDE; |
48 | 47 |
49 // content::NotificationObserver overrides: | 48 // content::NotificationObserver overrides: |
50 virtual void Observe(int type, | 49 virtual void Observe(int type, |
51 const content::NotificationSource& source, | 50 const content::NotificationSource& source, |
(...skipping 13 matching lines...) Expand all Loading... |
65 // Used to access the default zoom level preference. | 64 // Used to access the default zoom level preference. |
66 DoublePrefMember default_zoom_level_; | 65 DoublePrefMember default_zoom_level_; |
67 | 66 |
68 // Observer receiving notifications on state changes. | 67 // Observer receiving notifications on state changes. |
69 ZoomObserver* observer_; | 68 ZoomObserver* observer_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(ZoomController); | 70 DISALLOW_COPY_AND_ASSIGN(ZoomController); |
72 }; | 71 }; |
73 | 72 |
74 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ | 73 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_CONTROLLER_H_ |
OLD | NEW |