| 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 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Happens when the zoom changes for the active tab. |can_show_bubble| is | 99 // Happens when the zoom changes for the active tab. |can_show_bubble| is |
| 100 // false when the change in zoom for the active tab wasn't an explicit user | 100 // false when the change in zoom for the active tab wasn't an explicit user |
| 101 // action (e.g. switching tabs, creating a new tab, creating a new browser). | 101 // action (e.g. switching tabs, creating a new tab, creating a new browser). |
| 102 // Additionally, |can_show_bubble| will only be true when the bubble wouldn't | 102 // Additionally, |can_show_bubble| will only be true when the bubble wouldn't |
| 103 // be obscured by other UI (app menu) or redundant (+/- from app menu). | 103 // be obscured by other UI (app menu) or redundant (+/- from app menu). |
| 104 void ZoomChangedForActiveTab(bool can_show_bubble); | 104 void ZoomChangedForActiveTab(bool can_show_bubble); |
| 105 | 105 |
| 106 // Checks if the bookmark star should be enabled or not. | 106 // Checks if the bookmark star should be enabled or not. |
| 107 bool IsStarEnabled() const; | 107 bool IsStarEnabled() const; |
| 108 | 108 |
| 109 // Get the point in window coordinates on the star for the bookmark bubble to | 109 // Get the point in window coordinates in the |decoration| at which the |
| 110 // aim at. Only works if IsStarEnabled returns YES. | 110 // associate bubble aims. |
| 111 NSPoint GetBookmarkBubblePoint() const; | 111 NSPoint GetBubblePointForDecoration(LocationBarDecoration* decoration) const; |
| 112 | 112 |
| 113 // Get the point in window coordinates in the save credit card icon for the | 113 // Get the point in window coordinates in the save credit card icon for the |
| 114 // save credit card bubble to aim at. | 114 // save credit card bubble to aim at. |
| 115 NSPoint GetSaveCreditCardBubblePoint() const; | 115 NSPoint GetSaveCreditCardBubblePoint() const; |
| 116 | 116 |
| 117 // Get the point in window coordinates on the star for the Translate bubble to | |
| 118 // aim at. | |
| 119 NSPoint GetTranslateBubblePoint() const; | |
| 120 | |
| 121 // Get the point in window coordinates in the lock icon for the Manage | |
| 122 // Passwords bubble to aim at. | |
| 123 NSPoint GetManagePasswordsBubblePoint() const; | |
| 124 | |
| 125 // Get the point in window coordinates in the security icon at which the page | 117 // Get the point in window coordinates in the security icon at which the page |
| 126 // info bubble aims. | 118 // info bubble aims. |
| 127 NSPoint GetPageInfoBubblePoint() const; | 119 NSPoint GetPageInfoBubblePoint() const; |
| 128 | 120 |
| 129 // When any image decorations change, call this to ensure everything is | 121 // When any image decorations change, call this to ensure everything is |
| 130 // redrawn and laid out if necessary. | 122 // redrawn and laid out if necessary. |
| 131 void OnDecorationsChanged(); | 123 void OnDecorationsChanged(); |
| 132 | 124 |
| 133 // Layout the various decorations which live in the field. | 125 // Layout the various decorations which live in the field. |
| 134 void Layout(); | 126 void Layout(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 NSImage* GetKeywordImage(const base::string16& keyword); | 184 NSImage* GetKeywordImage(const base::string16& keyword); |
| 193 | 185 |
| 194 // Returns the color for the vector icon in the location bar. | 186 // Returns the color for the vector icon in the location bar. |
| 195 SkColor GetLocationBarIconColor() const; | 187 SkColor GetLocationBarIconColor() const; |
| 196 | 188 |
| 197 AutocompleteTextField* GetAutocompleteTextField() { return field_; } | 189 AutocompleteTextField* GetAutocompleteTextField() { return field_; } |
| 198 | 190 |
| 199 // Returns true if the location bar is dark. | 191 // Returns true if the location bar is dark. |
| 200 bool IsLocationBarDark() const; | 192 bool IsLocationBarDark() const; |
| 201 | 193 |
| 194 // Returns the decoration for the page info bubble. |
| 195 LocationBarDecoration* GetPageInfoDecoration() const; |
| 196 |
| 202 ManagePasswordsDecoration* manage_passwords_decoration() { | 197 ManagePasswordsDecoration* manage_passwords_decoration() { |
| 203 return manage_passwords_decoration_.get(); | 198 return manage_passwords_decoration_.get(); |
| 204 } | 199 } |
| 205 | 200 |
| 201 StarDecoration* star_decoration() const { return star_decoration_.get(); } |
| 202 |
| 203 TranslateDecoration* translate_decoration() const { |
| 204 return translate_decoration_.get(); |
| 205 } |
| 206 |
| 206 Browser* browser() const { return browser_; } | 207 Browser* browser() const { return browser_; } |
| 207 | 208 |
| 208 // ZoomManagerObserver: | 209 // ZoomManagerObserver: |
| 209 // Updates the view for the zoom icon when default zoom levels change. | 210 // Updates the view for the zoom icon when default zoom levels change. |
| 210 void OnDefaultZoomLevelChanged() override; | 211 void OnDefaultZoomLevelChanged() override; |
| 211 | 212 |
| 212 // Returns the decoration accessibility views for all of this | 213 // Returns the decoration accessibility views for all of this |
| 213 // LocationBarViewMac's decorations. The returned NSViews may not have been | 214 // LocationBarViewMac's decorations. The returned NSViews may not have been |
| 214 // positioned yet. | 215 // positioned yet. |
| 215 std::vector<NSView*> GetDecorationAccessibilityViews(); | 216 std::vector<NSView*> GetDecorationAccessibilityViews(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // The security level of the location bar icon. | 341 // The security level of the location bar icon. |
| 341 security_state::SecurityLevel security_level_; | 342 security_state::SecurityLevel security_level_; |
| 342 | 343 |
| 343 // Used to schedule a task for the first run info bubble. | 344 // Used to schedule a task for the first run info bubble. |
| 344 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 345 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
| 345 | 346 |
| 346 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 347 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
| 347 }; | 348 }; |
| 348 | 349 |
| 349 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 350 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
| OLD | NEW |