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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.h

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: fix cros build Created 3 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
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_TABS_TAB_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" 15 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
16 #include "ui/base/layout.h" 16 #include "ui/base/layout.h"
17 #include "ui/gfx/animation/animation_delegate.h" 17 #include "ui/gfx/animation/animation_delegate.h"
18 #include "ui/gfx/geometry/point.h" 18 #include "ui/gfx/geometry/point.h"
19 #include "ui/gfx/image/image_skia.h" 19 #include "ui/gfx/image/image_skia.h"
20 #include "ui/gfx/paint_throbber.h" 20 #include "ui/gfx/paint_throbber.h"
21 #include "ui/views/context_menu_controller.h" 21 #include "ui/views/context_menu_controller.h"
22 #include "ui/views/controls/button/button.h" 22 #include "ui/views/controls/button/image_button.h"
23 #include "ui/views/controls/glow_hover_controller.h" 23 #include "ui/views/controls/glow_hover_controller.h"
24 #include "ui/views/masked_targeter_delegate.h" 24 #include "ui/views/masked_targeter_delegate.h"
25 #include "ui/views/view.h" 25 #include "ui/views/view.h"
26 26
27 class AlertIndicatorButton; 27 class AlertIndicatorButton;
28 class TabController; 28 class TabController;
29 29
30 namespace gfx { 30 namespace gfx {
31 class Animation; 31 class Animation;
32 class AnimationContainer; 32 class AnimationContainer;
33 class LinearAnimation; 33 class LinearAnimation;
34 class ThrobAnimation; 34 class ThrobAnimation;
35 } 35 }
36 namespace views { 36 namespace views {
37 class ImageButton;
38 class Label; 37 class Label;
39 } 38 }
40 39
41 /////////////////////////////////////////////////////////////////////////////// 40 ///////////////////////////////////////////////////////////////////////////////
42 // 41 //
43 // A View that renders a Tab in a TabStrip. 42 // A View that renders a Tab in a TabStrip.
44 // 43 //
45 /////////////////////////////////////////////////////////////////////////////// 44 ///////////////////////////////////////////////////////////////////////////////
46 class Tab : public gfx::AnimationDelegate, 45 class Tab : public gfx::AnimationDelegate,
47 public views::ButtonListener, 46 public views::ImageButtonDelegate,
48 public views::ContextMenuController, 47 public views::ContextMenuController,
49 public views::MaskedTargeterDelegate, 48 public views::MaskedTargeterDelegate,
50 public views::View { 49 public views::View {
51 public: 50 public:
52 // The Tab's class name. 51 // The Tab's class name.
53 static const char kViewClassName[]; 52 static const char kViewClassName[];
54 53
55 // The amount of overlap between two adjacent tabs. 54 // The amount of overlap between two adjacent tabs.
56 static constexpr int kOverlap = 16; 55 static constexpr int kOverlap = 16;
57 56
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 class FaviconCrashAnimation; 176 class FaviconCrashAnimation;
178 177
179 class TabCloseButton; 178 class TabCloseButton;
180 class ThrobberView; 179 class ThrobberView;
181 180
182 // gfx::AnimationDelegate: 181 // gfx::AnimationDelegate:
183 void AnimationProgressed(const gfx::Animation* animation) override; 182 void AnimationProgressed(const gfx::Animation* animation) override;
184 void AnimationCanceled(const gfx::Animation* animation) override; 183 void AnimationCanceled(const gfx::Animation* animation) override;
185 void AnimationEnded(const gfx::Animation* animation) override; 184 void AnimationEnded(const gfx::Animation* animation) override;
186 185
187 // views::ButtonListener: 186 // views::ImageButtonDelegate:
188 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 187 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
189 188
190 // views::ContextMenuController: 189 // views::ContextMenuController:
191 void ShowContextMenuForView(views::View* source, 190 void ShowContextMenuForView(views::View* source,
192 const gfx::Point& point, 191 const gfx::Point& point,
193 ui::MenuSourceType source_type) override; 192 ui::MenuSourceType source_type) override;
194 193
195 // views::MaskedTargeterDelegate: 194 // views::MaskedTargeterDelegate:
196 bool GetHitTestMask(gfx::Path* mask) const override; 195 bool GetHitTestMask(gfx::Path* mask) const override;
197 196
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 351
353 // The favicon for the tab. This might be the sad tab icon or a copy of 352 // The favicon for the tab. This might be the sad tab icon or a copy of
354 // data().favicon and may be modified for theming. It is created on demand 353 // data().favicon and may be modified for theming. It is created on demand
355 // and thus may be null. 354 // and thus may be null.
356 gfx::ImageSkia favicon_; 355 gfx::ImageSkia favicon_;
357 356
358 DISALLOW_COPY_AND_ASSIGN(Tab); 357 DISALLOW_COPY_AND_ASSIGN(Tab);
359 }; 358 };
360 359
361 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ 360 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698