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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.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_item_view.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 | 16 |
17 namespace ui { | 17 namespace ui { |
18 class MenuModel; | 18 class MenuModel; |
19 } | 19 } |
20 | 20 |
21 namespace views { | 21 namespace views { |
22 class ImageButton; | 22 class ImageButton; |
23 class ImageView; | 23 class ImageView; |
24 class Label; | 24 class Label; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 int OffsetY(views::View* view) const; | 100 int OffsetY(views::View* view) const; |
101 | 101 |
102 // Convenience getter. | 102 // Convenience getter. |
103 const infobars::InfoBarContainer::Delegate* container_delegate() const; | 103 const infobars::InfoBarContainer::Delegate* container_delegate() const; |
104 | 104 |
105 // Shows a menu at the specified position. | 105 // Shows a menu at the specified position. |
106 // NOTE: This must not be called if we're unowned. (Subclasses should ignore | 106 // NOTE: This must not be called if we're unowned. (Subclasses should ignore |
107 // calls to RunMenu() in this case.) | 107 // calls to RunMenu() in this case.) |
108 void RunMenuAt(ui::MenuModel* menu_model, | 108 void RunMenuAt(ui::MenuModel* menu_model, |
109 views::MenuButton* button, | 109 views::MenuButton* button, |
110 views::MenuItemView::AnchorPosition anchor); | 110 views::MenuAnchorPosition anchor); |
111 | 111 |
112 private: | 112 private: |
113 // Does the actual work for AssignWidths(). Assumes |labels| is sorted by | 113 // Does the actual work for AssignWidths(). Assumes |labels| is sorted by |
114 // decreasing preferred width. | 114 // decreasing preferred width. |
115 static void AssignWidthsSorted(Labels* labels, int available_width); | 115 static void AssignWidthsSorted(Labels* labels, int available_width); |
116 | 116 |
117 // InfoBar: | 117 // InfoBar: |
118 virtual void PlatformSpecificShow(bool animate) OVERRIDE; | 118 virtual void PlatformSpecificShow(bool animate) OVERRIDE; |
119 virtual void PlatformSpecificHide(bool animate) OVERRIDE; | 119 virtual void PlatformSpecificHide(bool animate) OVERRIDE; |
120 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE; | 120 virtual void PlatformSpecificOnHeightsRecalculated() OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
139 SkPath fill_path_; | 139 SkPath fill_path_; |
140 SkPath stroke_path_; | 140 SkPath stroke_path_; |
141 | 141 |
142 // Used to run the menu. | 142 // Used to run the menu. |
143 scoped_ptr<views::MenuRunner> menu_runner_; | 143 scoped_ptr<views::MenuRunner> menu_runner_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(InfoBarView); | 145 DISALLOW_COPY_AND_ASSIGN(InfoBarView); |
146 }; | 146 }; |
147 | 147 |
148 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ | 148 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ |
OLD | NEW |