| 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_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // non-standard zoom level. | 23 // non-standard zoom level. |
| 24 class ZoomDecoration : public ImageDecoration, | 24 class ZoomDecoration : public ImageDecoration, |
| 25 public ZoomBubbleControllerDelegate { | 25 public ZoomBubbleControllerDelegate { |
| 26 public: | 26 public: |
| 27 explicit ZoomDecoration(LocationBarViewMac* owner); | 27 explicit ZoomDecoration(LocationBarViewMac* owner); |
| 28 ~ZoomDecoration() override; | 28 ~ZoomDecoration() override; |
| 29 | 29 |
| 30 // Called when this decoration should show or hide itself in its most current | 30 // Called when this decoration should show or hide itself in its most current |
| 31 // state. Returns whether any updates were made. | 31 // state. Returns whether any updates were made. |
| 32 bool UpdateIfNecessary(ui_zoom::ZoomController* zoom_controller, | 32 bool UpdateIfNecessary(ui_zoom::ZoomController* zoom_controller, |
| 33 bool default_zoom_changed); | 33 bool default_zoom_changed, |
| 34 bool location_bar_is_dark); |
| 34 | 35 |
| 35 // Shows the zoom bubble for this decoration. If |auto_close| is YES, then | 36 // Shows the zoom bubble for this decoration. If |auto_close| is YES, then |
| 36 // the bubble will automatically close after a fixed period of time. | 37 // the bubble will automatically close after a fixed period of time. |
| 37 // If a bubble is already showing, the |auto_close| timer is reset. | 38 // If a bubble is already showing, the |auto_close| timer is reset. |
| 38 void ShowBubble(BOOL auto_close); | 39 void ShowBubble(BOOL auto_close); |
| 39 | 40 |
| 40 // Closes the zoom bubble. | 41 // Closes the zoom bubble. |
| 41 void CloseBubble(); | 42 void CloseBubble(); |
| 42 | 43 |
| 43 protected: | 44 protected: |
| 44 // Hides all UI associated with the zoom decoration. | 45 // Hides all UI associated with the zoom decoration. |
| 45 // Virtual and protected for testing. | 46 // Virtual and protected for testing. |
| 46 virtual void HideUI(); | 47 virtual void HideUI(); |
| 47 | 48 |
| 48 // Show and update UI associated with the zoom decoration. | 49 // Show and update UI associated with the zoom decoration. |
| 49 // Virtual and protected for testing. | 50 // Virtual and protected for testing. |
| 50 virtual void ShowAndUpdateUI(ui_zoom::ZoomController* zoom_controller, | 51 virtual void ShowAndUpdateUI(ui_zoom::ZoomController* zoom_controller, |
| 51 NSString* tooltip_string); | 52 NSString* tooltip_string, |
| 53 bool location_bar_is_dark); |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 friend ZoomDecorationTest; | 56 friend ZoomDecorationTest; |
| 55 | 57 |
| 56 bool IsAtDefaultZoom() const; | 58 bool IsAtDefaultZoom() const; |
| 57 | 59 |
| 58 // Virtual for testing. | 60 // Virtual for testing. |
| 59 virtual bool ShouldShowDecoration() const; | 61 virtual bool ShouldShowDecoration() const; |
| 60 | 62 |
| 61 // LocationBarDecoration implementation. | 63 // LocationBarDecoration implementation. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 74 // The bubble that this decoration shows. Weak, owns self. | 76 // The bubble that this decoration shows. Weak, owns self. |
| 75 ZoomBubbleController* bubble_; | 77 ZoomBubbleController* bubble_; |
| 76 | 78 |
| 77 // The string to show for a tooltip. | 79 // The string to show for a tooltip. |
| 78 base::scoped_nsobject<NSString> tooltip_; | 80 base::scoped_nsobject<NSString> tooltip_; |
| 79 | 81 |
| 80 DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); | 82 DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ | 85 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ |
| OLD | NEW |