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_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_UI_ZOOM_ZOOM_OBSERVER_H_ |
6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_OBSERVER_H_ | 6 #define CHROME_BROWSER_UI_ZOOM_ZOOM_OBSERVER_H_ |
7 | 7 |
8 #include "chrome/browser/ui/zoom/zoom_controller.h" | |
9 | |
8 namespace content { | 10 namespace content { |
9 class WebContents; | 11 class WebContents; |
10 } | 12 } |
11 | 13 |
12 // Interface for objects that wish to be notified of changes in ZoomController. | 14 // Interface for objects that wish to be notified of changes in ZoomController. |
13 class ZoomObserver { | 15 class ZoomObserver { |
14 public: | 16 public: |
17 struct OnZoomChangedEventData { | |
Dan Beam
2014/07/03 01:28:53
nit: ZoomChangeData or ZoomChangeEventData
wjmaclean
2014/07/03 19:37:21
Done.
| |
18 OnZoomChangedEventData(content::WebContents* web_contents, | |
19 double old_zoom_level, | |
20 double new_zoom_level, | |
21 ZoomController::ZoomMode zoom_mode, | |
22 bool can_show_bubble) | |
23 : web_contents_(web_contents), | |
24 old_zoom_level_(old_zoom_level), | |
25 new_zoom_level_(new_zoom_level), | |
26 zoom_mode_(zoom_mode), | |
27 can_show_bubble_(can_show_bubble) {} | |
28 content::WebContents* web_contents_; | |
29 double old_zoom_level_; | |
30 double new_zoom_level_; | |
31 ZoomController::ZoomMode zoom_mode_; | |
32 bool can_show_bubble_; | |
Dan Beam
2014/07/03 01:28:53
_ implies these are private but default access in
wjmaclean
2014/07/03 19:37:21
Done.
| |
33 }; | |
Dan Beam
2014/07/03 01:28:53
struct OnZoomChangedEventData {
content::WebCont
wjmaclean
2014/07/03 19:37:21
Not sure I follow ... work in what sense?
Dan Beam
2014/07/07 17:04:17
no ctor or initializer list necessary
| |
34 | |
15 // Notification that the zoom percentage has changed. | 35 // Notification that the zoom percentage has changed. |
16 virtual void OnZoomChanged(content::WebContents* source, | 36 virtual void OnZoomChanged(const OnZoomChangedEventData& data) {} |
17 bool can_show_bubble) = 0; | |
18 | 37 |
19 protected: | 38 protected: |
20 virtual ~ZoomObserver() {} | 39 virtual ~ZoomObserver() {} |
21 }; | 40 }; |
22 | 41 |
23 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_OBSERVER_H_ | 42 #endif // CHROME_BROWSER_UI_ZOOM_ZOOM_OBSERVER_H_ |
OLD | NEW |