Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/ui/views/infobars/infobar_view.h

Issue 1777813002: MD - use new style of text button in infobars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uac button cleanup Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 61 static views::LabelButton* CreateTextButton(views::ButtonListener* listener,
62 const base::string16& text); 62 const base::string16& text);
63
64 // Like CreateTextButton, but specifically creates a LabelButton.
65 // TODO(estade): remove this function when MD is default.
66 static views::LabelButton* CreateLabelButton(views::ButtonListener* listener,
67 const base::string16& text);
68 63
69 // Given |labels| and the total |available_width| to display them in, sets 64 // Given |labels| and the total |available_width| to display them in, sets
70 // each label's size so that the longest label shrinks until it reaches the 65 // each label's size so that the longest label shrinks until it reaches the
71 // length of the next-longest label, then both shrink until reaching the 66 // length of the next-longest label, then both shrink until reaching the
72 // length of the next-longest, and so forth. 67 // length of the next-longest, and so forth.
73 static void AssignWidths(Labels* labels, int available_width); 68 static void AssignWidths(Labels* labels, int available_width);
74 69
75 // views::View: 70 // views::View:
76 void Layout() override; 71 void Layout() override;
77 void ViewHierarchyChanged( 72 void ViewHierarchyChanged(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 SkPath fill_path_; 139 SkPath fill_path_;
145 SkPath stroke_path_; 140 SkPath stroke_path_;
146 141
147 // Used to run the menu. 142 // Used to run the menu.
148 scoped_ptr<views::MenuRunner> menu_runner_; 143 scoped_ptr<views::MenuRunner> menu_runner_;
149 144
150 DISALLOW_COPY_AND_ASSIGN(InfoBarView); 145 DISALLOW_COPY_AND_ASSIGN(InfoBarView);
151 }; 146 };
152 147
153 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_ 148 #endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698