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

Side by Side Diff: chrome/browser/ui/views/dropdown_bar_view.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_DROPDOWN_BAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/ui/views/dropdown_bar_host.h" 9 #include "chrome/browser/ui/views/dropdown_bar_host.h"
10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" 10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
11 #include "ui/views/accessible_pane_view.h" 11 #include "ui/views/accessible_pane_view.h"
12 12
13 namespace gfx { 13 namespace gfx {
14 class Canvas; 14 class CanvasSkia;
15 } // namespace gfx 15 }
16 16
17 //////////////////////////////////////////////////////////////////////////////// 17 ////////////////////////////////////////////////////////////////////////////////
18 // 18 //
19 // The DropdownBarView is an abstract view to draw the UI controls of the 19 // The DropdownBarView is an abstract view to draw the UI controls of the
20 // DropdownBarHost. 20 // DropdownBarHost.
21 // 21 //
22 //////////////////////////////////////////////////////////////////////////////// 22 ////////////////////////////////////////////////////////////////////////////////
23 class DropdownBarView : public views::AccessiblePaneView, 23 class DropdownBarView : public views::AccessiblePaneView,
24 public DropdownBarHostDelegate { 24 public DropdownBarHostDelegate {
25 public: 25 public:
26 explicit DropdownBarView(DropdownBarHost* host); 26 explicit DropdownBarView(DropdownBarHost* host);
27 virtual ~DropdownBarView(); 27 virtual ~DropdownBarView();
28 28
29 // Updates the view to let it know where the host is clipping the 29 // Updates the view to let it know where the host is clipping the
30 // dropdown widget (while animating the opening or closing of the widget). 30 // dropdown widget (while animating the opening or closing of the widget).
31 virtual void SetAnimationOffset(int offset) OVERRIDE; 31 virtual void SetAnimationOffset(int offset) OVERRIDE;
32 32
33 // Returns the offset used while animating. 33 // Returns the offset used while animating.
34 int animation_offset() const { return animation_offset_; } 34 int animation_offset() const { return animation_offset_; }
35 35
36 protected: 36 protected:
37 // views::View: 37 // views::View:
38 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 38 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE;
39 39
40 // Returns the DropdownBarHost that manages this view. 40 // Returns the DropdownBarHost that manages this view.
41 DropdownBarHost* host() const { return host_; } 41 DropdownBarHost* host() const { return host_; }
42 42
43 void SetBackground(const SkBitmap* left_alpha_mask, 43 void SetBackground(const SkBitmap* left_alpha_mask,
44 const SkBitmap* right_alpha_mask); 44 const SkBitmap* right_alpha_mask);
45 void SetBorder(int left_border_bitmap_id, int middle_border_bitmap_id, 45 void SetBorder(int left_border_bitmap_id, int middle_border_bitmap_id,
46 int right_border_bitmap_id); 46 int right_border_bitmap_id);
47 47
48 private: 48 private:
49 // The dropdown bar host that controls this view. 49 // The dropdown bar host that controls this view.
50 DropdownBarHost* host_; 50 DropdownBarHost* host_;
51 51
52 // While animating, the host clips the widget and draws only the bottom 52 // While animating, the host clips the widget and draws only the bottom
53 // part of it. The view needs to know the pixel offset at which we are drawing 53 // part of it. The view needs to know the pixel offset at which we are drawing
54 // the widget so that we can draw the curved edges that attach to the toolbar 54 // the widget so that we can draw the curved edges that attach to the toolbar
55 // in the right location. 55 // in the right location.
56 int animation_offset_; 56 int animation_offset_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(DropdownBarView); 58 DISALLOW_COPY_AND_ASSIGN(DropdownBarView);
59 }; 59 };
60 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_VIEW_H_ 60 #endif // CHROME_BROWSER_UI_VIEWS_DROPDOWN_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698