Chromium Code Reviews| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 class GeneratedCreditCardDecoration; | 27 class GeneratedCreditCardDecoration; |
| 28 class KeywordHintDecoration; | 28 class KeywordHintDecoration; |
| 29 class LocationBarDecoration; | 29 class LocationBarDecoration; |
| 30 class LocationIconDecoration; | 30 class LocationIconDecoration; |
| 31 class MicSearchDecoration; | 31 class MicSearchDecoration; |
| 32 class PageActionDecoration; | 32 class PageActionDecoration; |
| 33 class Profile; | 33 class Profile; |
| 34 class SearchButtonDecoration; | 34 class SearchButtonDecoration; |
| 35 class SelectedKeywordDecoration; | 35 class SelectedKeywordDecoration; |
| 36 class StarDecoration; | 36 class StarDecoration; |
| 37 class TranslateDecoration; | |
| 37 class ZoomDecoration; | 38 class ZoomDecoration; |
| 38 class ZoomDecorationTest; | 39 class ZoomDecorationTest; |
| 39 | 40 |
| 40 // A C++ bridge class that represents the location bar UI element to | 41 // A C++ bridge class that represents the location bar UI element to |
| 41 // the portable code. Wires up an OmniboxViewMac instance to | 42 // the portable code. Wires up an OmniboxViewMac instance to |
| 42 // the location bar text field, which handles most of the work. | 43 // the location bar text field, which handles most of the work. |
| 43 | 44 |
| 44 class LocationBarViewMac : public LocationBar, | 45 class LocationBarViewMac : public LocationBar, |
| 45 public LocationBarTesting, | 46 public LocationBarTesting, |
| 46 public OmniboxEditController, | 47 public OmniboxEditController, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 virtual void TestPageActionPressed(size_t index) OVERRIDE; | 82 virtual void TestPageActionPressed(size_t index) OVERRIDE; |
| 82 virtual bool GetBookmarkStarVisibility() OVERRIDE; | 83 virtual bool GetBookmarkStarVisibility() OVERRIDE; |
| 83 | 84 |
| 84 // Set/Get the editable state of the field. | 85 // Set/Get the editable state of the field. |
| 85 void SetEditable(bool editable); | 86 void SetEditable(bool editable); |
| 86 bool IsEditable(); | 87 bool IsEditable(); |
| 87 | 88 |
| 88 // Set the starred state of the bookmark star. | 89 // Set the starred state of the bookmark star. |
| 89 void SetStarred(bool starred); | 90 void SetStarred(bool starred); |
| 90 | 91 |
| 92 // Set whether or not the translate icon is lit. | |
| 93 void SetTranslateIconLit(bool on); | |
| 94 | |
| 91 // Happens when the zoom changes for the active tab. |can_show_bubble| is | 95 // Happens when the zoom changes for the active tab. |can_show_bubble| is |
| 92 // false when the change in zoom for the active tab wasn't an explicit user | 96 // false when the change in zoom for the active tab wasn't an explicit user |
| 93 // action (e.g. switching tabs, creating a new tab, creating a new browser). | 97 // action (e.g. switching tabs, creating a new tab, creating a new browser). |
| 94 // Additionally, |can_show_bubble| will only be true when the bubble wouldn't | 98 // Additionally, |can_show_bubble| will only be true when the bubble wouldn't |
| 95 // be obscured by other UI (wrench menu) or redundant (+/- from wrench). | 99 // be obscured by other UI (wrench menu) or redundant (+/- from wrench). |
| 96 void ZoomChangedForActiveTab(bool can_show_bubble); | 100 void ZoomChangedForActiveTab(bool can_show_bubble); |
| 97 | 101 |
| 98 // Checks if the bookmark star should be enabled or not. | 102 // Checks if the bookmark star should be enabled or not. |
| 99 bool IsStarEnabled() const; | 103 bool IsStarEnabled() const; |
| 100 | 104 |
| 101 // Get the point in window coordinates on the star for the bookmark bubble to | 105 // Get the point in window coordinates on the star for the bookmark bubble to |
| 102 // aim at. Only works if IsStarEnabled returns YES. | 106 // aim at. Only works if IsStarEnabled returns YES. |
| 103 NSPoint GetBookmarkBubblePoint() const; | 107 NSPoint GetBookmarkBubblePoint() const; |
| 104 | 108 |
| 109 NSPoint GetTranslateBubblePoint() const; | |
|
Robert Sesek
2014/02/27 20:45:01
Comment please.
hajimehoshi
2014/02/28 04:25:22
Done.
| |
| 110 | |
| 105 // Get the point in window coordinates in the security icon at which the page | 111 // Get the point in window coordinates in the security icon at which the page |
| 106 // info bubble aims. | 112 // info bubble aims. |
| 107 NSPoint GetPageInfoBubblePoint() const; | 113 NSPoint GetPageInfoBubblePoint() const; |
| 108 | 114 |
| 109 // Get the point in window coordinates in the "generated cc" icon at which the | 115 // Get the point in window coordinates in the "generated cc" icon at which the |
| 110 // corresponding info bubble aims. | 116 // corresponding info bubble aims. |
| 111 NSPoint GetGeneratedCreditCardBubblePoint() const; | 117 NSPoint GetGeneratedCreditCardBubblePoint() const; |
| 112 | 118 |
| 113 // When any image decorations change, call this to ensure everything is | 119 // When any image decorations change, call this to ensure everything is |
| 114 // redrawn and laid out if necessary. | 120 // redrawn and laid out if necessary. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 // Re-generate the page-action decorations from the profile's | 185 // Re-generate the page-action decorations from the profile's |
| 180 // extension service. | 186 // extension service. |
| 181 void RefreshPageActionDecorations(); | 187 void RefreshPageActionDecorations(); |
| 182 | 188 |
| 183 // Updates visibility of the content settings icons based on the current | 189 // Updates visibility of the content settings icons based on the current |
| 184 // tab contents state. | 190 // tab contents state. |
| 185 bool RefreshContentSettingsDecorations(); | 191 bool RefreshContentSettingsDecorations(); |
| 186 | 192 |
| 187 void ShowFirstRunBubbleInternal(); | 193 void ShowFirstRunBubbleInternal(); |
| 188 | 194 |
| 195 // Updates the translate decoration in the omnibox with the current translate | |
| 196 // state. | |
| 197 void UpdateTranslateDecoration(); | |
| 198 | |
| 189 // Updates the zoom decoration in the omnibox with the current zoom level. | 199 // Updates the zoom decoration in the omnibox with the current zoom level. |
| 190 void UpdateZoomDecoration(); | 200 void UpdateZoomDecoration(); |
| 191 | 201 |
| 192 // Ensures the star decoration is visible or hidden, as required. | 202 // Ensures the star decoration is visible or hidden, as required. |
| 193 void UpdateStarDecorationVisibility(); | 203 void UpdateStarDecorationVisibility(); |
| 194 | 204 |
| 195 // Updates the voice search decoration. Returns true if the visible state was | 205 // Updates the voice search decoration. Returns true if the visible state was |
| 196 // changed. | 206 // changed. |
| 197 bool UpdateMicSearchDecorationVisibility(); | 207 bool UpdateMicSearchDecorationVisibility(); |
| 198 | 208 |
| 199 scoped_ptr<OmniboxViewMac> omnibox_view_; | 209 scoped_ptr<OmniboxViewMac> omnibox_view_; |
| 200 | 210 |
| 201 AutocompleteTextField* field_; // owned by tab controller | 211 AutocompleteTextField* field_; // owned by tab controller |
| 202 | 212 |
| 203 // A decoration that shows an icon to the left of the address. | 213 // A decoration that shows an icon to the left of the address. |
| 204 scoped_ptr<LocationIconDecoration> location_icon_decoration_; | 214 scoped_ptr<LocationIconDecoration> location_icon_decoration_; |
| 205 | 215 |
| 206 // A decoration that shows the keyword-search bubble on the left. | 216 // A decoration that shows the keyword-search bubble on the left. |
| 207 scoped_ptr<SelectedKeywordDecoration> selected_keyword_decoration_; | 217 scoped_ptr<SelectedKeywordDecoration> selected_keyword_decoration_; |
| 208 | 218 |
| 209 // A decoration that shows a lock icon and ev-cert label in a bubble | 219 // A decoration that shows a lock icon and ev-cert label in a bubble |
| 210 // on the left. | 220 // on the left. |
| 211 scoped_ptr<EVBubbleDecoration> ev_bubble_decoration_; | 221 scoped_ptr<EVBubbleDecoration> ev_bubble_decoration_; |
| 212 | 222 |
| 213 // Bookmark star right of page actions. | 223 // Bookmark star right of page actions. |
| 214 scoped_ptr<StarDecoration> star_decoration_; | 224 scoped_ptr<StarDecoration> star_decoration_; |
| 215 | 225 |
| 226 // Translate icon at the end of the ominibox. | |
| 227 scoped_ptr<TranslateDecoration> translate_decoration_; | |
| 228 | |
| 216 // A zoom icon at the end of the omnibox, which shows at non-standard zoom | 229 // A zoom icon at the end of the omnibox, which shows at non-standard zoom |
| 217 // levels. | 230 // levels. |
| 218 scoped_ptr<ZoomDecoration> zoom_decoration_; | 231 scoped_ptr<ZoomDecoration> zoom_decoration_; |
| 219 | 232 |
| 220 // The installed page actions. | 233 // The installed page actions. |
| 221 std::vector<ExtensionAction*> page_actions_; | 234 std::vector<ExtensionAction*> page_actions_; |
| 222 | 235 |
| 223 // Decorations for the installed Page Actions. | 236 // Decorations for the installed Page Actions. |
| 224 ScopedVector<PageActionDecoration> page_action_decorations_; | 237 ScopedVector<PageActionDecoration> page_action_decorations_; |
| 225 | 238 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 246 // Used to schedule a task for the first run info bubble. | 259 // Used to schedule a task for the first run info bubble. |
| 247 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 260 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
| 248 | 261 |
| 249 // Used to change the visibility of the star decoration. | 262 // Used to change the visibility of the star decoration. |
| 250 BooleanPrefMember edit_bookmarks_enabled_; | 263 BooleanPrefMember edit_bookmarks_enabled_; |
| 251 | 264 |
| 252 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 265 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
| 253 }; | 266 }; |
| 254 | 267 |
| 255 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 268 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
| OLD | NEW |