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

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

Issue 10855154: Update browserAction.setIcon and pageAction.setIcon for hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits 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"
11 #include "content/public/browser/notification_observer.h" 11 #include "content/public/browser/notification_observer.h"
12 #include "ui/views/context_menu_controller.h" 12 #include "ui/views/context_menu_controller.h"
13 #include "ui/views/controls/button/menu_button.h" 13 #include "ui/views/controls/button/menu_button.h"
14 #include "ui/views/controls/button/menu_button_listener.h" 14 #include "ui/views/controls/button/menu_button_listener.h"
15 #include "ui/views/drag_controller.h" 15 #include "ui/views/drag_controller.h"
16 #include "ui/views/view.h" 16 #include "ui/views/view.h"
17 17
18 class Browser; 18 class Browser;
19 class BrowserActionButton; 19 class BrowserActionButton;
20 class ExtensionAction; 20 class ExtensionAction;
21 21
22 namespace extensions { 22 namespace extensions {
23 class Extension; 23 class Extension;
24 } 24 }
25 25
26 namespace gfx {
27 class Image;
28 }
29
26 namespace views { 30 namespace views {
27 class MenuItemView; 31 class MenuItemView;
28 class MenuRunner; 32 class MenuRunner;
29 } 33 }
30 34
31 //////////////////////////////////////////////////////////////////////////////// 35 ////////////////////////////////////////////////////////////////////////////////
32 // BrowserActionView 36 // BrowserActionView
33 // A single entry in the browser action container. This contains the actual 37 // A single entry in the browser action container. This contains the actual
34 // BrowserActionButton, as well as the logic to paint the badge. 38 // BrowserActionButton, as well as the logic to paint the badge.
35 class BrowserActionView : public views::View { 39 class BrowserActionView : public views::View {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // Notifications when to set button state to pushed/not pushed (for when the 167 // Notifications when to set button state to pushed/not pushed (for when the
164 // popup/context menu is hidden or shown by the container). 168 // popup/context menu is hidden or shown by the container).
165 void SetButtonPushed(); 169 void SetButtonPushed();
166 void SetButtonNotPushed(); 170 void SetButtonNotPushed();
167 171
168 // Whether the browser action is enabled on this tab. Note that we cannot use 172 // Whether the browser action is enabled on this tab. Note that we cannot use
169 // the built-in views enabled/SetEnabled because disabled views do not 173 // the built-in views enabled/SetEnabled because disabled views do not
170 // receive drag events. 174 // receive drag events.
171 bool IsEnabled(int tab_id) const; 175 bool IsEnabled(int tab_id) const;
172 176
177 // Returns button icon so it can be accessed during tests.
178 gfx::ImageSkia GetIconForTest();
179
173 protected: 180 protected:
174 // Overridden from views::View: 181 // Overridden from views::View:
175 virtual void ViewHierarchyChanged(bool is_add, 182 virtual void ViewHierarchyChanged(bool is_add,
176 View* parent, 183 View* parent,
177 View* child) OVERRIDE; 184 View* child) OVERRIDE;
178 185
179 private: 186 private:
180 virtual ~BrowserActionButton(); 187 virtual ~BrowserActionButton();
181 188
182 // Register an extension command if the extension has an active one. 189 // Register an extension command if the extension has an active one.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 225
219 // Responsible for running the menu. 226 // Responsible for running the menu.
220 scoped_ptr<views::MenuRunner> menu_runner_; 227 scoped_ptr<views::MenuRunner> menu_runner_;
221 228
222 friend class base::DeleteHelper<BrowserActionButton>; 229 friend class base::DeleteHelper<BrowserActionButton>;
223 230
224 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); 231 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton);
225 }; 232 };
226 233
227 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_ 234 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTION_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698