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

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

Issue 9562038: ui/gfx: Make gfx::Canvas inherit from gfx::CanvasSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes Created 8 years, 9 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_ACTIONS_CONTAINER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_
6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 class BrowserActionView : public views::View { 164 class BrowserActionView : public views::View {
165 public: 165 public:
166 BrowserActionView(const Extension* extension, BrowserActionsContainer* panel); 166 BrowserActionView(const Extension* extension, BrowserActionsContainer* panel);
167 virtual ~BrowserActionView(); 167 virtual ~BrowserActionView();
168 168
169 BrowserActionButton* button() { return button_; } 169 BrowserActionButton* button() { return button_; }
170 170
171 // Allocates a canvas object on the heap and draws into it the icon for the 171 // Allocates a canvas object on the heap and draws into it the icon for the
172 // view as well as the badge (if any). Caller is responsible for deleting the 172 // view as well as the badge (if any). Caller is responsible for deleting the
173 // returned object. 173 // returned object.
174 gfx::Canvas* GetIconWithBadge(); 174 gfx::CanvasSkia* GetIconWithBadge();
175 175
176 // Overridden from views::View: 176 // Overridden from views::View:
177 virtual void Layout() OVERRIDE; 177 virtual void Layout() OVERRIDE;
178 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 178 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
179 179
180 protected: 180 protected:
181 // Overridden from views::View to paint the badge on top of children. 181 // Overridden from views::View to paint the badge on top of children.
182 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; 182 virtual void PaintChildren(gfx::CanvasSkia* canvas) OVERRIDE;
183 183
184 private: 184 private:
185 // The container for this view. 185 // The container for this view.
186 BrowserActionsContainer* panel_; 186 BrowserActionsContainer* panel_;
187 187
188 // The button this view contains. 188 // The button this view contains.
189 BrowserActionButton* button_; 189 BrowserActionButton* button_;
190 190
191 DISALLOW_COPY_AND_ASSIGN(BrowserActionView); 191 DISALLOW_COPY_AND_ASSIGN(BrowserActionView);
192 }; 192 };
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // During testing we can disable animations by setting this flag to true, 390 // During testing we can disable animations by setting this flag to true,
391 // so that the bar resizes instantly, instead of having to poll it while it 391 // so that the bar resizes instantly, instead of having to poll it while it
392 // animates to open/closed status. 392 // animates to open/closed status.
393 static bool disable_animations_during_testing_; 393 static bool disable_animations_during_testing_;
394 394
395 protected: 395 protected:
396 // Overridden from views::View: 396 // Overridden from views::View:
397 virtual void ViewHierarchyChanged(bool is_add, 397 virtual void ViewHierarchyChanged(bool is_add,
398 views::View* parent, 398 views::View* parent,
399 views::View* child) OVERRIDE; 399 views::View* child) OVERRIDE;
400 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 400 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE;
401 virtual void OnThemeChanged() OVERRIDE; 401 virtual void OnThemeChanged() OVERRIDE;
402 402
403 private: 403 private:
404 friend class BrowserActionView; // So it can access IconHeight(). 404 friend class BrowserActionView; // So it can access IconHeight().
405 friend class ShowFolderMenuTask; 405 friend class ShowFolderMenuTask;
406 406
407 typedef std::vector<BrowserActionView*> BrowserActionViews; 407 typedef std::vector<BrowserActionView*> BrowserActionViews;
408 408
409 // Returns the width of an icon, optionally with its padding. 409 // Returns the width of an icon, optionally with its padding.
410 static int IconWidth(bool include_padding); 410 static int IconWidth(bool include_padding);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 527
528 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; 528 base::WeakPtrFactory<BrowserActionsContainer> task_factory_;
529 529
530 // Handles delayed showing of the overflow menu when hovering. 530 // Handles delayed showing of the overflow menu when hovering.
531 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; 531 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_;
532 532
533 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); 533 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer);
534 }; 534 };
535 535
536 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ 536 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698