| 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" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 views::Label* CreateLabel(const base::string16& text) const; | 51 views::Label* CreateLabel(const base::string16& text) const; |
| 52 | 52 |
| 53 // Creates a link with the appropriate font and color for an infobar. | 53 // Creates a link with the appropriate font and color for an infobar. |
| 54 // NOTE: Subclasses must ignore link clicks if we're unowned. | 54 // NOTE: Subclasses must ignore link clicks if we're unowned. |
| 55 views::Link* CreateLink(const base::string16& text, | 55 views::Link* CreateLink(const base::string16& text, |
| 56 views::LinkListener* listener) const; | 56 views::LinkListener* listener) const; |
| 57 | 57 |
| 58 // Creates a focusable button for use on an infobar. The appearance is | 58 // Creates a focusable button for use on an infobar. The appearance is |
| 59 // customized for infobars (except in Material mode). | 59 // customized for infobars (except in Material mode). |
| 60 // NOTE: Subclasses must ignore button presses if we're unowned. | 60 // NOTE: Subclasses must ignore button presses if we're unowned. |
| 61 static views::Button* CreateTextButton(views::ButtonListener* listener, |
| 62 const base::string16& text); |
| 63 |
| 64 // Like CreateTextButton, but specifically creates a LabelButton. |
| 65 // TODO(estade): remove this function when MD is default. |
| 61 static views::LabelButton* CreateLabelButton(views::ButtonListener* listener, | 66 static views::LabelButton* CreateLabelButton(views::ButtonListener* listener, |
| 62 const base::string16& text); | 67 const base::string16& text); |
| 63 | 68 |
| 64 // Given |labels| and the total |available_width| to display them in, sets | 69 // Given |labels| and the total |available_width| to display them in, sets |
| 65 // each label's size so that the longest label shrinks until it reaches the | 70 // each label's size so that the longest label shrinks until it reaches the |
| 66 // length of the next-longest label, then both shrink until reaching the | 71 // length of the next-longest label, then both shrink until reaching the |
| 67 // length of the next-longest, and so forth. | 72 // length of the next-longest, and so forth. |
| 68 static void AssignWidths(Labels* labels, int available_width); | 73 static void AssignWidths(Labels* labels, int available_width); |
| 69 | 74 |
| 70 // views::View: | 75 // views::View: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 SkPath fill_path_; | 136 SkPath fill_path_; |
| 132 SkPath stroke_path_; | 137 SkPath stroke_path_; |
| 133 | 138 |
| 134 // Used to run the menu. | 139 // Used to run the menu. |
| 135 scoped_ptr<views::MenuRunner> menu_runner_; | 140 scoped_ptr<views::MenuRunner> menu_runner_; |
| 136 | 141 |
| 137 DISALLOW_COPY_AND_ASSIGN(InfoBarView); | 142 DISALLOW_COPY_AND_ASSIGN(InfoBarView); |
| 138 }; | 143 }; |
| 139 | 144 |
| 140 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ | 145 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ |
| OLD | NEW |