| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Hides all UI associated with the zoom decoration. | 45 // Hides all UI associated with the zoom decoration. |
| 46 // Virtual and protected for testing. | 46 // Virtual and protected for testing. |
| 47 virtual void HideUI(); | 47 virtual void HideUI(); |
| 48 | 48 |
| 49 // Show and update UI associated with the zoom decoration. | 49 // Show and update UI associated with the zoom decoration. |
| 50 // Virtual and protected for testing. | 50 // Virtual and protected for testing. |
| 51 virtual void ShowAndUpdateUI(ui_zoom::ZoomController* zoom_controller, | 51 virtual void ShowAndUpdateUI(ui_zoom::ZoomController* zoom_controller, |
| 52 NSString* tooltip_string, | 52 NSString* tooltip_string, |
| 53 bool location_bar_is_dark); | 53 bool location_bar_is_dark); |
| 54 | 54 |
| 55 // Overridden from LocationBarDecoration: |
| 56 gfx::VectorIconId GetMaterialVectorIconId() override; |
| 57 |
| 55 private: | 58 private: |
| 56 friend ZoomDecorationTest; | 59 friend ZoomDecorationTest; |
| 57 | 60 |
| 58 bool IsAtDefaultZoom() const; | 61 bool IsAtDefaultZoom() const; |
| 59 | 62 |
| 60 // Virtual for testing. | 63 // Virtual for testing. |
| 61 virtual bool ShouldShowDecoration() const; | 64 virtual bool ShouldShowDecoration() const; |
| 62 | 65 |
| 63 // LocationBarDecoration implementation. | 66 // LocationBarDecoration implementation. |
| 64 bool AcceptsMousePress() override; | 67 bool AcceptsMousePress() override; |
| 65 bool OnMousePressed(NSRect frame, NSPoint location) override; | 68 bool OnMousePressed(NSRect frame, NSPoint location) override; |
| 66 NSString* GetToolTip() override; | 69 NSString* GetToolTip() override; |
| 67 NSPoint GetBubblePointInFrame(NSRect frame) override; | 70 NSPoint GetBubblePointInFrame(NSRect frame) override; |
| 68 | 71 |
| 69 // ZoomBubbleControllerDelegate implementation. | 72 // ZoomBubbleControllerDelegate implementation. |
| 70 content::WebContents* GetWebContents() override; | 73 content::WebContents* GetWebContents() override; |
| 71 void OnClose() override; | 74 void OnClose() override; |
| 72 | 75 |
| 73 // The control that owns this. Weak. | 76 // The control that owns this. Weak. |
| 74 LocationBarViewMac* owner_; | 77 LocationBarViewMac* owner_; |
| 75 | 78 |
| 76 // The bubble that this decoration shows. Weak, owns self. | 79 // The bubble that this decoration shows. Weak, owns self. |
| 77 ZoomBubbleController* bubble_; | 80 ZoomBubbleController* bubble_; |
| 78 | 81 |
| 79 // The string to show for a tooltip. | 82 // The string to show for a tooltip. |
| 80 base::scoped_nsobject<NSString> tooltip_; | 83 base::scoped_nsobject<NSString> tooltip_; |
| 81 | 84 |
| 85 gfx::VectorIconId vector_icon_id_; |
| 86 |
| 82 DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); | 87 DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); |
| 83 }; | 88 }; |
| 84 | 89 |
| 85 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ | 90 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ |
| OLD | NEW |