Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(884)

Side by Side Diff: chrome/browser/cocoa/location_bar_view_mac.h

Issue 515027: Fixes bug where a Page Action icon was not being properly displayed upon page... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Second upload to get try server. Created 10 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_COCOA_LOCATION_BAR_VIEW_MAC_H_ 5 #ifndef CHROME_BROWSER_COCOA_LOCATION_BAR_VIEW_MAC_H_
6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_VIEW_MAC_H_ 6 #define CHROME_BROWSER_COCOA_LOCATION_BAR_VIEW_MAC_H_
7 7
8 #include <string> 8 #include <string>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 @class ExtensionPopupController; 26 @class ExtensionPopupController;
27 class Profile; 27 class Profile;
28 class ToolbarModel; 28 class ToolbarModel;
29 29
30 // A C++ bridge class that represents the location bar UI element to 30 // A C++ bridge class that represents the location bar UI element to
31 // the portable code. Wires up an AutocompleteEditViewMac instance to 31 // the portable code. Wires up an AutocompleteEditViewMac instance to
32 // the location bar text field, which handles most of the work. 32 // the location bar text field, which handles most of the work.
33 33
34 class LocationBarViewMac : public AutocompleteEditController, 34 class LocationBarViewMac : public AutocompleteEditController,
35 public LocationBar, 35 public LocationBar,
36 public LocationBarTesting { 36 public LocationBarTesting,
37 public NotificationObserver {
37 public: 38 public:
38 LocationBarViewMac(AutocompleteTextField* field, 39 LocationBarViewMac(AutocompleteTextField* field,
39 const BubblePositioner* bubble_positioner, 40 const BubblePositioner* bubble_positioner,
40 CommandUpdater* command_updater, 41 CommandUpdater* command_updater,
41 ToolbarModel* toolbar_model, 42 ToolbarModel* toolbar_model,
42 Profile* profile); 43 Profile* profile);
43 virtual ~LocationBarViewMac(); 44 virtual ~LocationBarViewMac();
44 45
45 // Overridden from LocationBar: 46 // Overridden from LocationBar:
46 virtual void ShowFirstRunBubble(bool use_OEM_bubble) { NOTIMPLEMENTED(); } 47 virtual void ShowFirstRunBubble(bool use_OEM_bubble) { NOTIMPLEMENTED(); }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Internals of OnChanged(), pulled out for purposes of unit 90 // Internals of OnChanged(), pulled out for purposes of unit
90 // testing. Sets up |field| based on the parameters, which are 91 // testing. Sets up |field| based on the parameters, which are
91 // pulled from edit_view->model(). 92 // pulled from edit_view->model().
92 static void OnChangedImpl(AutocompleteTextField* field, 93 static void OnChangedImpl(AutocompleteTextField* field,
93 const std::wstring& keyword, 94 const std::wstring& keyword,
94 const std::wstring& short_name, 95 const std::wstring& short_name,
95 const bool is_keyword_hint, 96 const bool is_keyword_hint,
96 const bool show_search_hint, 97 const bool show_search_hint,
97 NSImage* image); 98 NSImage* image);
98 99
100 // Overridden from NotificationObserver.
101 virtual void Observe(NotificationType type,
102 const NotificationSource& source,
103 const NotificationDetails& details);
104
99 // Used to display a clickable icon in the location bar. 105 // Used to display a clickable icon in the location bar.
100 class LocationBarImageView { 106 class LocationBarImageView {
101 public: 107 public:
102 explicit LocationBarImageView() : image_(nil), 108 explicit LocationBarImageView() : image_(nil),
103 label_(nil), 109 label_(nil),
104 visible_(false) {} 110 visible_(false) {}
105 virtual ~LocationBarImageView() {} 111 virtual ~LocationBarImageView() {}
106 112
107 // Sets the image. 113 // Sets the image.
108 void SetImage(NSImage* image); 114 void SetImage(NSImage* image);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 Profile* profile_; 324 Profile* profile_;
319 325
320 ToolbarModel* toolbar_model_; // Weak, owned by Browser. 326 ToolbarModel* toolbar_model_; // Weak, owned by Browser.
321 327
322 // Image used in drawing keyword hint. 328 // Image used in drawing keyword hint.
323 scoped_nsobject<NSImage> tab_button_image_; 329 scoped_nsobject<NSImage> tab_button_image_;
324 330
325 // The transition type to use for the navigation. 331 // The transition type to use for the navigation.
326 PageTransition::Type transition_; 332 PageTransition::Type transition_;
327 333
334 // Used to register for notifications received by NotificationObserver.
335 NotificationRegistrar registrar_;
336
328 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); 337 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac);
329 }; 338 };
330 339
331 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_VIEW_MAC_H_ 340 #endif // CHROME_BROWSER_COCOA_LOCATION_BAR_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698