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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 bool location_bar_is_dark); | 53 bool location_bar_is_dark); |
54 | 54 |
55 // Overridden from LocationBarDecoration: | 55 // Overridden from LocationBarDecoration: |
56 const gfx::VectorIcon* GetMaterialVectorIcon() const override; | 56 const gfx::VectorIcon* GetMaterialVectorIcon() const override; |
57 | 57 |
58 private: | 58 private: |
59 friend ZoomDecorationTest; | 59 friend ZoomDecorationTest; |
60 | 60 |
61 bool IsAtDefaultZoom() const; | 61 bool IsAtDefaultZoom() const; |
62 | 62 |
| 63 // Returns true when |bubble_| or the views zoom bubble exists. |
| 64 bool IsBubbleShown() const; |
| 65 |
63 // Virtual for testing. | 66 // Virtual for testing. |
64 virtual bool ShouldShowDecoration() const; | 67 virtual bool ShouldShowDecoration() const; |
65 | 68 |
66 // LocationBarDecoration implementation. | 69 // LocationBarDecoration implementation. |
67 bool AcceptsMousePress() override; | 70 bool AcceptsMousePress() override; |
68 bool OnMousePressed(NSRect frame, NSPoint location) override; | 71 bool OnMousePressed(NSRect frame, NSPoint location) override; |
69 NSString* GetToolTip() override; | 72 NSString* GetToolTip() override; |
70 NSPoint GetBubblePointInFrame(NSRect frame) override; | 73 NSPoint GetBubblePointInFrame(NSRect frame) override; |
71 | 74 |
72 // ZoomBubbleControllerDelegate implementation. | 75 // ZoomBubbleControllerDelegate implementation. |
73 content::WebContents* GetWebContents() override; | 76 content::WebContents* GetWebContents() override; |
74 void OnClose() override; | 77 void OnClose() override; |
75 | 78 |
76 // The control that owns this. Weak. | 79 // The control that owns this. Weak. |
77 LocationBarViewMac* owner_; | 80 LocationBarViewMac* owner_; |
78 | 81 |
79 // The bubble that this decoration shows. Weak, owns self. | 82 // The bubble that this decoration shows. Weak, owns self. |
80 ZoomBubbleController* bubble_; | 83 ZoomBubbleController* bubble_; |
81 | 84 |
82 // The string to show for a tooltip. | 85 // The string to show for a tooltip. |
83 base::scoped_nsobject<NSString> tooltip_; | 86 base::scoped_nsobject<NSString> tooltip_; |
84 | 87 |
85 const gfx::VectorIcon* vector_icon_; | 88 const gfx::VectorIcon* vector_icon_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); | 90 DISALLOW_COPY_AND_ASSIGN(ZoomDecoration); |
88 }; | 91 }; |
89 | 92 |
90 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ | 93 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ZOOM_DECORATION_H_ |
OLD | NEW |