| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 void PlatformSpecificHide(bool animate) override; | 119 void PlatformSpecificHide(bool animate) override; |
| 118 void PlatformSpecificOnHeightsRecalculated() override; | 120 void PlatformSpecificOnHeightsRecalculated() override; |
| 119 | 121 |
| 120 // views::View: | 122 // views::View: |
| 121 void GetAccessibleState(ui::AXViewState* state) override; | 123 void GetAccessibleState(ui::AXViewState* state) override; |
| 122 gfx::Size GetPreferredSize() const override; | 124 gfx::Size GetPreferredSize() const override; |
| 123 | 125 |
| 124 // views::ExternalFocusTracker: | 126 // views::ExternalFocusTracker: |
| 125 void OnWillChangeFocus(View* focused_before, View* focused_now) override; | 127 void OnWillChangeFocus(View* focused_before, View* focused_now) override; |
| 126 | 128 |
| 129 // views::ViewTargeterDelegate: |
| 130 bool DoesIntersectRect(const View* target, |
| 131 const gfx::Rect& rect) const override; |
| 132 |
| 127 // This container holds the children and clips their painting during | 133 // This container holds the children and clips their painting during |
| 128 // animation. | 134 // animation. |
| 129 views::View* child_container_; | 135 views::View* child_container_; |
| 130 | 136 |
| 131 // The optional icon at the left edge of the InfoBar. | 137 // The optional icon at the left edge of the InfoBar. |
| 132 views::ImageView* icon_; | 138 views::ImageView* icon_; |
| 133 | 139 |
| 134 // The close button at the right edge of the InfoBar. | 140 // The close button at the right edge of the InfoBar. |
| 135 views::ImageButton* close_button_; | 141 views::ImageButton* close_button_; |
| 136 | 142 |
| 137 // The paths for the InfoBarBackground to draw, sized according to the heights | 143 // The paths for the InfoBarBackground to draw, sized according to the heights |
| 138 // above. | 144 // above. |
| 139 SkPath fill_path_; | 145 SkPath fill_path_; |
| 140 SkPath stroke_path_; | 146 SkPath stroke_path_; |
| 141 | 147 |
| 142 // Used to run the menu. | 148 // Used to run the menu. |
| 143 scoped_ptr<views::MenuRunner> menu_runner_; | 149 scoped_ptr<views::MenuRunner> menu_runner_; |
| 144 | 150 |
| 145 DISALLOW_COPY_AND_ASSIGN(InfoBarView); | 151 DISALLOW_COPY_AND_ASSIGN(InfoBarView); |
| 146 }; | 152 }; |
| 147 | 153 |
| 148 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ | 154 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ |
| OLD | NEW |