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

Side by Side Diff: ui/views/controls/button/md_text_button.h

Issue 1817253003: [MD] Use same focus ring on BarControlButton as MdTextButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update docs 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
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_
6 #define UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ 6 #define UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/views/animation/button_ink_drop_delegate.h" 9 #include "ui/views/animation/button_ink_drop_delegate.h"
10 #include "ui/views/controls/button/label_button.h" 10 #include "ui/views/controls/button/label_button.h"
(...skipping 14 matching lines...) Expand all
25 // Creates a normal STYLE_BUTTON LabelButton in pre-MD, or an MdTextButton 25 // Creates a normal STYLE_BUTTON LabelButton in pre-MD, or an MdTextButton
26 // in MD mode. 26 // in MD mode.
27 static LabelButton* CreateStandardButton(ButtonListener* listener, 27 static LabelButton* CreateStandardButton(ButtonListener* listener,
28 const base::string16& text); 28 const base::string16& text);
29 static MdTextButton* CreateMdButton(ButtonListener* listener, 29 static MdTextButton* CreateMdButton(ButtonListener* listener,
30 const base::string16& text); 30 const base::string16& text);
31 31
32 void SetCallToAction(CallToAction cta); 32 void SetCallToAction(CallToAction cta);
33 33
34 // LabelButton: 34 // LabelButton:
35 void Layout() override;
36 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 35 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
37 SkColor GetInkDropBaseColor() const override; 36 SkColor GetInkDropBaseColor() const override;
38 void SetText(const base::string16& text) override; 37 void SetText(const base::string16& text) override;
39 38
40 protected:
41 // LabelButton:
42 void OnFocus() override;
43 void OnBlur() override;
44
45 private: 39 private:
46 MdTextButton(ButtonListener* listener); 40 MdTextButton(ButtonListener* listener);
47 ~MdTextButton() override; 41 ~MdTextButton() override;
48 42
49 void UpdateColorsFromNativeTheme(); 43 void UpdateColorsFromNativeTheme();
50 44
51 ButtonInkDropDelegate ink_drop_delegate_; 45 ButtonInkDropDelegate ink_drop_delegate_;
52 46
53 // A child view to draw the focus ring. This is not done via a FocusPainter
54 // because it needs to paint to a layer so it can extend beyond the bounds of
55 // |this|.
56 views::View* focus_ring_;
57
58 // The call to action style for this button. 47 // The call to action style for this button.
59 CallToAction cta_; 48 CallToAction cta_;
60 49
61 DISALLOW_COPY_AND_ASSIGN(MdTextButton); 50 DISALLOW_COPY_AND_ASSIGN(MdTextButton);
62 }; 51 };
63 52
64 } // namespace views 53 } // namespace views
65 54
66 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ 55 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698