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

Side by Side Diff: ui/views/examples/button_sticker_sheet.cc

Issue 2383243002: Refactor MdFocusRing to make it easier to reuse on other controls. (Closed)
Patch Set: explicit onfocus Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "ui/views/examples/button_sticker_sheet.h" 5 #include "ui/views/examples/button_sticker_sheet.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/views/controls/button/button.h" 9 #include "ui/views/controls/button/button.h"
10 #include "ui/views/controls/button/md_text_button.h" 10 #include "ui/views/controls/button/md_text_button.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 MakeButtonsInState(&primary, &secondary, this, Button::STATE_NORMAL); 109 MakeButtonsInState(&primary, &secondary, this, Button::STATE_NORMAL);
110 AddLabelledRowToGridLayout(layout, "Default", {primary, secondary}); 110 AddLabelledRowToGridLayout(layout, "Default", {primary, secondary});
111 MakeButtonsInState(&primary, &secondary, this, Button::STATE_NORMAL); 111 MakeButtonsInState(&primary, &secondary, this, Button::STATE_NORMAL);
112 AddLabelledRowToGridLayout(layout, "Normal", {primary, secondary}); 112 AddLabelledRowToGridLayout(layout, "Normal", {primary, secondary});
113 MakeButtonsInState(&primary, &secondary, this, Button::STATE_HOVERED); 113 MakeButtonsInState(&primary, &secondary, this, Button::STATE_HOVERED);
114 AddLabelledRowToGridLayout(layout, "Hovered", {primary, secondary}); 114 AddLabelledRowToGridLayout(layout, "Hovered", {primary, secondary});
115 MakeButtonsInState(&primary, &secondary, this, Button::STATE_PRESSED); 115 MakeButtonsInState(&primary, &secondary, this, Button::STATE_PRESSED);
116 AddLabelledRowToGridLayout(layout, "Pressed", {primary, secondary}); 116 AddLabelledRowToGridLayout(layout, "Pressed", {primary, secondary});
117 MakeButtonsInState(&primary, &secondary, this, Button::STATE_DISABLED); 117 MakeButtonsInState(&primary, &secondary, this, Button::STATE_DISABLED);
118 AddLabelledRowToGridLayout(layout, "Disabled", {primary, secondary}); 118 AddLabelledRowToGridLayout(layout, "Disabled", {primary, secondary});
119
120 MakeButtonsInState(&primary, &secondary, this, Button::STATE_NORMAL);
121 primary->OnFocus();
122 secondary->OnFocus();
123 AddLabelledRowToGridLayout(layout, "Focused", {primary, secondary});
124 } 119 }
125 120
126 void ButtonStickerSheet::ButtonPressed(Button* button, const ui::Event& event) { 121 void ButtonStickerSheet::ButtonPressed(Button* button, const ui::Event& event) {
127 // Ignore button presses. 122 // Ignore button presses.
128 } 123 }
129 124
130 } // namespace examples 125 } // namespace examples
131 } // namespace views 126 } // namespace views
OLDNEW
« ui/views/controls/textfield/textfield.cc ('K') | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698