Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_INFOBARS_INFOBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
| 11 #include "components/infobars/core/infobar_container.h" | 11 #include "components/infobars/core/infobar_container.h" |
| 12 #include "third_party/skia/include/core/SkPath.h" | 12 #include "third_party/skia/include/core/SkPath.h" |
| 13 #include "ui/views/controls/button/button.h" | 13 #include "ui/views/controls/button/button.h" |
| 14 #include "ui/views/controls/menu/menu_types.h" | 14 #include "ui/views/controls/menu/menu_types.h" |
| 15 #include "ui/views/focus/external_focus_tracker.h" | 15 #include "ui/views/focus/external_focus_tracker.h" |
| 16 #include "ui/views/view_targeter_delegate.h" | |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 class MenuModel; | 19 class MenuModel; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace views { | 22 namespace views { |
| 22 class ImageButton; | 23 class ImageButton; |
| 23 class ImageView; | 24 class ImageView; |
| 24 class Label; | 25 class Label; |
| 25 class LabelButton; | 26 class LabelButton; |
| 26 class Link; | 27 class Link; |
| 27 class LinkListener; | 28 class LinkListener; |
| 28 class MenuButton; | 29 class MenuButton; |
| 29 class MenuRunner; | 30 class MenuRunner; |
| 30 } // namespace views | 31 } // namespace views |
| 31 | 32 |
| 32 class InfoBarView : public infobars::InfoBar, | 33 class InfoBarView : public infobars::InfoBar, |
| 33 public views::View, | 34 public views::View, |
| 34 public views::ButtonListener, | 35 public views::ButtonListener, |
| 35 public views::ExternalFocusTracker { | 36 public views::ExternalFocusTracker, |
| 37 public views::ViewTargeterDelegate { | |
| 36 public: | 38 public: |
| 37 explicit InfoBarView(scoped_ptr<infobars::InfoBarDelegate> delegate); | 39 explicit InfoBarView(scoped_ptr<infobars::InfoBarDelegate> delegate); |
| 38 | 40 |
| 39 const SkPath& fill_path() const { return fill_path_; } | 41 const SkPath& fill_path() const { return fill_path_; } |
| 40 const SkPath& stroke_path() const { return stroke_path_; } | 42 const SkPath& stroke_path() const { return stroke_path_; } |
| 41 | 43 |
| 42 protected: | 44 protected: |
| 43 typedef std::vector<views::Label*> Labels; | 45 typedef std::vector<views::Label*> Labels; |
| 44 | 46 |
| 45 static const int kButtonButtonSpacing; | 47 static const int kButtonButtonSpacing; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 void PlatformSpecificHide(bool animate) override; | 124 void PlatformSpecificHide(bool animate) override; |
| 123 void PlatformSpecificOnHeightsRecalculated() override; | 125 void PlatformSpecificOnHeightsRecalculated() override; |
| 124 | 126 |
| 125 // views::View: | 127 // views::View: |
| 126 void GetAccessibleState(ui::AXViewState* state) override; | 128 void GetAccessibleState(ui::AXViewState* state) override; |
| 127 gfx::Size GetPreferredSize() const override; | 129 gfx::Size GetPreferredSize() const override; |
| 128 | 130 |
| 129 // views::ExternalFocusTracker: | 131 // views::ExternalFocusTracker: |
| 130 void OnWillChangeFocus(View* focused_before, View* focused_now) override; | 132 void OnWillChangeFocus(View* focused_before, View* focused_now) override; |
| 131 | 133 |
| 134 // ViewTargeterDelegate: | |
|
Peter Kasting
2016/03/08 01:08:17
Nit: views::
Evan Stade
2016/03/08 01:43:29
Done.
| |
| 135 bool DoesIntersectRect(const View* target, | |
| 136 const gfx::Rect& rect) const override; | |
| 137 | |
| 132 // This container holds the children and clips their painting during | 138 // This container holds the children and clips their painting during |
| 133 // animation. | 139 // animation. |
| 134 views::View* child_container_; | 140 views::View* child_container_; |
| 135 | 141 |
| 136 // The optional icon at the left edge of the InfoBar. | 142 // The optional icon at the left edge of the InfoBar. |
| 137 views::ImageView* icon_; | 143 views::ImageView* icon_; |
| 138 | 144 |
| 139 // The close button at the right edge of the InfoBar. | 145 // The close button at the right edge of the InfoBar. |
| 140 views::ImageButton* close_button_; | 146 views::ImageButton* close_button_; |
| 141 | 147 |
| 142 // The paths for the InfoBarBackground to draw, sized according to the heights | 148 // The paths for the InfoBarBackground to draw, sized according to the heights |
| 143 // above. | 149 // above. |
| 144 SkPath fill_path_; | 150 SkPath fill_path_; |
| 145 SkPath stroke_path_; | 151 SkPath stroke_path_; |
| 146 | 152 |
| 147 // Used to run the menu. | 153 // Used to run the menu. |
| 148 scoped_ptr<views::MenuRunner> menu_runner_; | 154 scoped_ptr<views::MenuRunner> menu_runner_; |
| 149 | 155 |
| 150 DISALLOW_COPY_AND_ASSIGN(InfoBarView); | 156 DISALLOW_COPY_AND_ASSIGN(InfoBarView); |
| 151 }; | 157 }; |
| 152 | 158 |
| 153 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ | 159 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ |
| OLD | NEW |