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_LOCATION_BAR_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 class EVBubbleDecoration; | 31 class EVBubbleDecoration; |
32 class KeywordHintDecoration; | 32 class KeywordHintDecoration; |
33 class LocationBarDecoration; | 33 class LocationBarDecoration; |
34 class LocationIconDecoration; | 34 class LocationIconDecoration; |
35 class PageActionDecoration; | 35 class PageActionDecoration; |
36 class Profile; | 36 class Profile; |
37 class SelectedKeywordDecoration; | 37 class SelectedKeywordDecoration; |
38 class SkBitmap; | 38 class SkBitmap; |
39 class StarDecoration; | 39 class StarDecoration; |
40 class ToolbarModel; | 40 class ToolbarModel; |
| 41 class ZoomDecoration; |
41 | 42 |
42 // A C++ bridge class that represents the location bar UI element to | 43 // A C++ bridge class that represents the location bar UI element to |
43 // the portable code. Wires up an OmniboxViewMac instance to | 44 // the portable code. Wires up an OmniboxViewMac instance to |
44 // the location bar text field, which handles most of the work. | 45 // the location bar text field, which handles most of the work. |
45 | 46 |
46 class LocationBarViewMac : public LocationBar, | 47 class LocationBarViewMac : public LocationBar, |
47 public LocationBarTesting, | 48 public LocationBarTesting, |
48 public OmniboxEditController, | 49 public OmniboxEditController, |
49 public content::NotificationObserver, | 50 public content::NotificationObserver, |
50 public CommandObserver { | 51 public CommandObserver { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Set/Get the editable state of the field. | 86 // Set/Get the editable state of the field. |
86 void SetEditable(bool editable); | 87 void SetEditable(bool editable); |
87 bool IsEditable(); | 88 bool IsEditable(); |
88 | 89 |
89 // Set the starred state of the bookmark star. | 90 // Set the starred state of the bookmark star. |
90 void SetStarred(bool starred); | 91 void SetStarred(bool starred); |
91 | 92 |
92 // Set ChromeToMobileDecoration's lit state (to update the icon). | 93 // Set ChromeToMobileDecoration's lit state (to update the icon). |
93 void SetChromeToMobileDecorationLit(bool lit); | 94 void SetChromeToMobileDecorationLit(bool lit); |
94 | 95 |
| 96 // Happens when the zoom changes for the active tab. |can_show_bubble| = true |
| 97 // indicates it's worth showing a bubble over this change, where as |
| 98 // |can_show_bubble| = false means it probably wasn't a very interesting |
| 99 // change (e.g. switching tabs, creating a new tab, creating a new browser). |
| 100 void ZoomChangedForActiveTab(bool can_show_bubble); |
| 101 |
95 // Get the point in window coordinates on the star for the bookmark bubble to | 102 // Get the point in window coordinates on the star for the bookmark bubble to |
96 // aim at. | 103 // aim at. |
97 NSPoint GetBookmarkBubblePoint() const; | 104 NSPoint GetBookmarkBubblePoint() const; |
98 | 105 |
99 // Get the point in window coordinates on the Chrome To Mobile icon for | 106 // Get the point in window coordinates on the Chrome To Mobile icon for |
100 // anchoring its bubble. | 107 // anchoring its bubble. |
101 NSPoint GetChromeToMobileBubblePoint() const; | 108 NSPoint GetChromeToMobileBubblePoint() const; |
102 | 109 |
103 // Get the point in window coordinates in the security icon at which the page | 110 // Get the point in window coordinates in the security icon at which the page |
104 // info bubble aims. | 111 // info bubble aims. |
105 NSPoint GetPageInfoBubblePoint() const; | 112 NSPoint GetPageInfoBubblePoint() const; |
106 | 113 |
| 114 // When any image decorations change, call this to ensure everything is |
| 115 // redrawn and laid out if necessary. |
| 116 void OnImageDecorationsChanged(); |
| 117 |
107 // Updates the location bar. Resets the bar's permanent text and | 118 // Updates the location bar. Resets the bar's permanent text and |
108 // security style, and if |should_restore_state| is true, restores | 119 // security style, and if |should_restore_state| is true, restores |
109 // saved state from the tab (for tab switching). | 120 // saved state from the tab (for tab switching). |
110 void Update(const content::WebContents* tab, bool should_restore_state); | 121 void Update(const content::WebContents* tab, bool should_restore_state); |
111 | 122 |
112 // Layout the various decorations which live in the field. | 123 // Layout the various decorations which live in the field. |
113 void Layout(); | 124 void Layout(); |
114 | 125 |
115 // Re-draws |decoration| if it's already being displayed. | 126 // Re-draws |decoration| if it's already being displayed. |
116 void RedrawDecoration(LocationBarDecoration* decoration); | 127 void RedrawDecoration(LocationBarDecoration* decoration); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // A decoration that shows a lock icon and ev-cert label in a bubble | 227 // A decoration that shows a lock icon and ev-cert label in a bubble |
217 // on the left. | 228 // on the left. |
218 scoped_ptr<EVBubbleDecoration> ev_bubble_decoration_; | 229 scoped_ptr<EVBubbleDecoration> ev_bubble_decoration_; |
219 | 230 |
220 // Bookmark star right of page actions. | 231 // Bookmark star right of page actions. |
221 scoped_ptr<StarDecoration> star_decoration_; | 232 scoped_ptr<StarDecoration> star_decoration_; |
222 | 233 |
223 // Chrome To Mobile page action icon. | 234 // Chrome To Mobile page action icon. |
224 scoped_ptr<ChromeToMobileDecoration> chrome_to_mobile_decoration_; | 235 scoped_ptr<ChromeToMobileDecoration> chrome_to_mobile_decoration_; |
225 | 236 |
| 237 // A zoom icon at the end of the omnibox, which shows at non-standard zoom |
| 238 // levels. |
| 239 scoped_ptr<ZoomDecoration> zoom_decoration_; |
| 240 |
226 // The installed page actions. | 241 // The installed page actions. |
227 std::vector<ExtensionAction*> page_actions_; | 242 std::vector<ExtensionAction*> page_actions_; |
228 | 243 |
229 // Decorations for the installed Page Actions. | 244 // Decorations for the installed Page Actions. |
230 ScopedVector<PageActionDecoration> page_action_decorations_; | 245 ScopedVector<PageActionDecoration> page_action_decorations_; |
231 | 246 |
232 // The content blocked decorations. | 247 // The content blocked decorations. |
233 ScopedVector<ContentSettingDecoration> content_setting_decorations_; | 248 ScopedVector<ContentSettingDecoration> content_setting_decorations_; |
234 | 249 |
235 // Keyword hint decoration displayed on the right-hand side. | 250 // Keyword hint decoration displayed on the right-hand side. |
(...skipping 14 matching lines...) Expand all Loading... |
250 // Used to schedule a task for the first run info bubble. | 265 // Used to schedule a task for the first run info bubble. |
251 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 266 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
252 | 267 |
253 // Used to change the visibility of the star decoration. | 268 // Used to change the visibility of the star decoration. |
254 BooleanPrefMember edit_bookmarks_enabled_; | 269 BooleanPrefMember edit_bookmarks_enabled_; |
255 | 270 |
256 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 271 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
257 }; | 272 }; |
258 | 273 |
259 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 274 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
OLD | NEW |