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