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> |
| 11 | 11 |
| 12 #include "base/memory/scoped_nsobject.h" | 12 #include "base/memory/scoped_nsobject.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/prefs/public/pref_member.h" | 16 #include "base/prefs/public/pref_member.h" |
| 17 #include "chrome/browser/extensions/image_loading_tracker.h" | 17 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 19 #include "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
| 20 #include "chrome/browser/ui/omnibox/location_bar.h" | 20 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 21 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 21 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| 22 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 22 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 23 #include "chrome/common/content_settings_types.h" | 23 #include "chrome/common/content_settings_types.h" |
| 24 | 24 |
| 25 @class AutocompleteTextField; | 25 @class AutocompleteTextField; |
| 26 class CommandUpdater; | 26 class CommandUpdater; |
| 27 class ContentSettingDecoration; | 27 class ContentSettingDecoration; |
| 28 class EVBubbleDecoration; | 28 class EVBubbleDecoration; |
| 29 class KeywordHintDecoration; | 29 class KeywordHintDecoration; |
| 30 class LocationBarViewMacBrowserTest; | |
|
kuan
2013/01/23 17:01:32
nit: wrong alphabetical order
sail
2013/01/27 21:11:07
Done.
| |
| 30 class LocationBarDecoration; | 31 class LocationBarDecoration; |
| 31 class LocationIconDecoration; | 32 class LocationIconDecoration; |
| 32 class PageActionDecoration; | 33 class PageActionDecoration; |
| 33 class PlusDecoration; | 34 class PlusDecoration; |
| 34 class Profile; | 35 class Profile; |
| 36 class SearchTokenDecoration; | |
| 35 class SelectedKeywordDecoration; | 37 class SelectedKeywordDecoration; |
| 38 class SeparatorDecoration; | |
| 36 class StarDecoration; | 39 class StarDecoration; |
| 37 class ToolbarModel; | 40 class ToolbarModel; |
| 38 class WebIntentsButtonDecoration; | 41 class WebIntentsButtonDecoration; |
| 39 class ZoomDecoration; | 42 class ZoomDecoration; |
| 40 | 43 |
| 41 // A C++ bridge class that represents the location bar UI element to | 44 // A C++ bridge class that represents the location bar UI element to |
| 42 // the portable code. Wires up an OmniboxViewMac instance to | 45 // the portable code. Wires up an OmniboxViewMac instance to |
| 43 // the location bar text field, which handles most of the work. | 46 // the location bar text field, which handles most of the work. |
| 44 | 47 |
| 45 class LocationBarViewMac : public LocationBar, | 48 class LocationBarViewMac : public LocationBar, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 177 |
| 175 | 178 |
| 176 // content::NotificationObserver: | 179 // content::NotificationObserver: |
| 177 virtual void Observe(int type, | 180 virtual void Observe(int type, |
| 178 const content::NotificationSource& source, | 181 const content::NotificationSource& source, |
| 179 const content::NotificationDetails& details) OVERRIDE; | 182 const content::NotificationDetails& details) OVERRIDE; |
| 180 | 183 |
| 181 Browser* browser() const { return browser_; } | 184 Browser* browser() const { return browser_; } |
| 182 | 185 |
| 183 private: | 186 private: |
| 187 friend LocationBarViewMacBrowserTest; | |
| 188 | |
| 184 // Posts |notification| to the default notification center. | 189 // Posts |notification| to the default notification center. |
| 185 void PostNotification(NSString* notification); | 190 void PostNotification(NSString* notification); |
| 186 | 191 |
| 187 // Return the decoration for |page_action|. | 192 // Return the decoration for |page_action|. |
| 188 PageActionDecoration* GetPageActionDecoration(ExtensionAction* page_action); | 193 PageActionDecoration* GetPageActionDecoration(ExtensionAction* page_action); |
| 189 | 194 |
| 190 // Clear the page-action decorations. | 195 // Clear the page-action decorations. |
| 191 void DeletePageActionDecorations(); | 196 void DeletePageActionDecorations(); |
| 192 | 197 |
| 193 void OnEditBookmarksEnabledChanged(); | 198 void OnEditBookmarksEnabledChanged(); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 211 | 216 |
| 212 // Updates the zoom decoration in the omnibox with the current zoom level. | 217 // Updates the zoom decoration in the omnibox with the current zoom level. |
| 213 void UpdateZoomDecoration(); | 218 void UpdateZoomDecoration(); |
| 214 | 219 |
| 215 // Ensures the star decoration is visible or hidden, as required. | 220 // Ensures the star decoration is visible or hidden, as required. |
| 216 void UpdateStarDecorationVisibility(); | 221 void UpdateStarDecorationVisibility(); |
| 217 | 222 |
| 218 // Ensures the plus decoration is visible or hidden, as required. | 223 // Ensures the plus decoration is visible or hidden, as required. |
| 219 void UpdatePlusDecorationVisibility(); | 224 void UpdatePlusDecorationVisibility(); |
| 220 | 225 |
| 226 // Gets the current search provider name. | |
| 227 string16 GetSearchProviderName() const; | |
| 228 | |
| 221 scoped_ptr<OmniboxViewMac> omnibox_view_; | 229 scoped_ptr<OmniboxViewMac> omnibox_view_; |
| 222 | 230 |
| 223 CommandUpdater* command_updater_; // Weak, owned by Browser. | 231 CommandUpdater* command_updater_; // Weak, owned by Browser. |
| 224 | 232 |
| 225 AutocompleteTextField* field_; // owned by tab controller | 233 AutocompleteTextField* field_; // owned by tab controller |
| 226 | 234 |
| 227 // When we get an OnAutocompleteAccept notification from the autocomplete | 235 // When we get an OnAutocompleteAccept notification from the autocomplete |
| 228 // edit, we save the input string so we can give it back to the browser on | 236 // edit, we save the input string so we can give it back to the browser on |
| 229 // the LocationBar interface via GetInputString(). | 237 // the LocationBar interface via GetInputString(). |
| 230 string16 location_input_; | 238 string16 location_input_; |
| 231 | 239 |
| 232 // The user's desired disposition for how their input should be opened. | 240 // The user's desired disposition for how their input should be opened. |
| 233 WindowOpenDisposition disposition_; | 241 WindowOpenDisposition disposition_; |
| 234 | 242 |
| 235 // A decoration that shows an icon to the left of the address. | 243 // A decoration that shows an icon to the left of the address. |
| 236 scoped_ptr<LocationIconDecoration> location_icon_decoration_; | 244 scoped_ptr<LocationIconDecoration> location_icon_decoration_; |
| 237 | 245 |
| 246 // A decoration that shows the search provider being used. | |
| 247 scoped_ptr<SearchTokenDecoration> search_token_decoration_; | |
| 248 | |
| 238 // A decoration that shows the keyword-search bubble on the left. | 249 // A decoration that shows the keyword-search bubble on the left. |
| 239 scoped_ptr<SelectedKeywordDecoration> selected_keyword_decoration_; | 250 scoped_ptr<SelectedKeywordDecoration> selected_keyword_decoration_; |
| 240 | 251 |
| 252 // A decoration used to draw a separator between other decorations. | |
| 253 scoped_ptr<SeparatorDecoration> separator_decoration_; | |
| 254 | |
| 241 // A decoration that shows a lock icon and ev-cert label in a bubble | 255 // A decoration that shows a lock icon and ev-cert label in a bubble |
| 242 // on the left. | 256 // on the left. |
| 243 scoped_ptr<EVBubbleDecoration> ev_bubble_decoration_; | 257 scoped_ptr<EVBubbleDecoration> ev_bubble_decoration_; |
| 244 | 258 |
| 245 // Action "plus" button right of bookmark star. | 259 // Action "plus" button right of bookmark star. |
| 246 scoped_ptr<PlusDecoration> plus_decoration_; | 260 scoped_ptr<PlusDecoration> plus_decoration_; |
| 247 | 261 |
| 248 // Bookmark star right of page actions. | 262 // Bookmark star right of page actions. |
| 249 scoped_ptr<StarDecoration> star_decoration_; | 263 scoped_ptr<StarDecoration> star_decoration_; |
| 250 | 264 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 // Used to schedule a task for the first run info bubble. | 297 // Used to schedule a task for the first run info bubble. |
| 284 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 298 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
| 285 | 299 |
| 286 // Used to change the visibility of the star decoration. | 300 // Used to change the visibility of the star decoration. |
| 287 BooleanPrefMember edit_bookmarks_enabled_; | 301 BooleanPrefMember edit_bookmarks_enabled_; |
| 288 | 302 |
| 289 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 303 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
| 290 }; | 304 }; |
| 291 | 305 |
| 292 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 306 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
| OLD | NEW |