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

Side by Side Diff: chrome/browser/ui/views/browser_action_view.h

Issue 10806058: Move icon fallbacks into ExtensionAction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move the icon cache inside ExtensionAction. Created 8 years, 4 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
OLDNEW
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_VIEWS_BROWSER_ACTION_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/image_loading_tracker.h" 10 #include "chrome/browser/extensions/image_loading_tracker.h"
(...skipping 27 matching lines...) Expand all
38 38
39 // Call this instead of delete. 39 // Call this instead of delete.
40 void Destroy(); 40 void Destroy();
41 41
42 ExtensionAction* browser_action() const { return browser_action_; } 42 ExtensionAction* browser_action() const { return browser_action_; }
43 const extensions::Extension* extension() { return extension_; } 43 const extensions::Extension* extension() { return extension_; }
44 44
45 // Called to update the display to match the browser action's state. 45 // Called to update the display to match the browser action's state.
46 void UpdateState(); 46 void UpdateState();
47 47
48 // Returns the default icon, if any.
49 const SkBitmap& default_icon() const { return default_icon_; }
50
51 // Does this button's action have a popup? 48 // Does this button's action have a popup?
52 virtual bool IsPopup(); 49 virtual bool IsPopup();
53 virtual GURL GetPopupUrl(); 50 virtual GURL GetPopupUrl();
54 51
55 // Overridden from views::View: 52 // Overridden from views::View:
56 virtual bool CanHandleAccelerators() const OVERRIDE; 53 virtual bool CanHandleAccelerators() const OVERRIDE;
57 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 54 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
58 55
59 // Overridden from views::ButtonListener: 56 // Overridden from views::ButtonListener:
60 virtual void ButtonPressed(views::Button* sender, 57 virtual void ButtonPressed(views::Button* sender,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // by this class. 115 // by this class.
119 ExtensionAction* browser_action_; 116 ExtensionAction* browser_action_;
120 117
121 // The extension associated with the browser action we're displaying. 118 // The extension associated with the browser action we're displaying.
122 const extensions::Extension* extension_; 119 const extensions::Extension* extension_;
123 120
124 // The object that is waiting for the image loading to complete 121 // The object that is waiting for the image loading to complete
125 // asynchronously. 122 // asynchronously.
126 ImageLoadingTracker tracker_; 123 ImageLoadingTracker tracker_;
127 124
128 // The default icon for our browser action. This might be non-empty if the
129 // browser action had a value for default_icon in the manifest.
130 SkBitmap default_icon_;
131
132 // The browser action shelf. 125 // The browser action shelf.
133 BrowserActionsContainer* panel_; 126 BrowserActionsContainer* panel_;
134 127
135 // The context menu. This member is non-NULL only when the menu is shown. 128 // The context menu. This member is non-NULL only when the menu is shown.
136 views::MenuItemView* context_menu_; 129 views::MenuItemView* context_menu_;
137 130
138 content::NotificationRegistrar registrar_; 131 content::NotificationRegistrar registrar_;
139 132
140 // The extension keybinding accelerator this browser action is listening for 133 // The extension keybinding accelerator this browser action is listening for
141 // (to show the popup). 134 // (to show the popup).
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // The container for this view. 170 // The container for this view.
178 BrowserActionsContainer* panel_; 171 BrowserActionsContainer* panel_;
179 172
180 // The button this view contains. 173 // The button this view contains.
181 BrowserActionButton* button_; 174 BrowserActionButton* button_;
182 175
183 DISALLOW_COPY_AND_ASSIGN(BrowserActionView); 176 DISALLOW_COPY_AND_ASSIGN(BrowserActionView);
184 }; 177 };
185 178
186 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ 179 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698