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

Side by Side Diff: ui/views/touchui/touch_selection_menu_runner_views.cc

Issue 1963563002: Views: Flip default value of CustomButton::request_focus_on_press_ to false. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 7 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/examples/widget_example.cc ('k') | no next file » | 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 #include "ui/views/touchui/touch_selection_menu_runner_views.h" 5 #include "ui/views/touchui/touch_selection_menu_runner_views.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 Button* TouchSelectionMenuRunnerViews::Menu::CreateButton( 156 Button* TouchSelectionMenuRunnerViews::Menu::CreateButton(
157 const base::string16& title, 157 const base::string16& title,
158 int tag) { 158 int tag) {
159 base::string16 label = 159 base::string16 label =
160 gfx::RemoveAcceleratorChar(title, '&', nullptr, nullptr); 160 gfx::RemoveAcceleratorChar(title, '&', nullptr, nullptr);
161 LabelButton* button = new LabelButton(this, label); 161 LabelButton* button = new LabelButton(this, label);
162 button->SetMinSize(gfx::Size(kMenuButtonMinWidth, kMenuButtonMinHeight)); 162 button->SetMinSize(gfx::Size(kMenuButtonMinWidth, kMenuButtonMinHeight));
163 Button::ConfigureDefaultFocus(button); 163 Button::ConfigureDefaultFocus(button);
164 button->set_request_focus_on_press(false);
165 const gfx::FontList& font_list = 164 const gfx::FontList& font_list =
166 ui::ResourceBundle::GetSharedInstance().GetFontList( 165 ui::ResourceBundle::GetSharedInstance().GetFontList(
167 ui::ResourceBundle::SmallFont); 166 ui::ResourceBundle::SmallFont);
168 button->SetFontList(font_list); 167 button->SetFontList(font_list);
169 button->SetHorizontalAlignment(gfx::ALIGN_CENTER); 168 button->SetHorizontalAlignment(gfx::ALIGN_CENTER);
170 button->set_tag(tag); 169 button->set_tag(tag);
171 return button; 170 return button;
172 } 171 }
173 172
174 void TouchSelectionMenuRunnerViews::Menu::CloseMenu() { 173 void TouchSelectionMenuRunnerViews::Menu::CloseMenu() {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // Closing the menu sets |menu_| to nullptr and eventually deletes the object. 270 // Closing the menu sets |menu_| to nullptr and eventually deletes the object.
272 menu_->CloseMenu(); 271 menu_->CloseMenu();
273 DCHECK(!menu_); 272 DCHECK(!menu_);
274 } 273 }
275 274
276 bool TouchSelectionMenuRunnerViews::IsRunning() const { 275 bool TouchSelectionMenuRunnerViews::IsRunning() const {
277 return menu_ != nullptr; 276 return menu_ != nullptr;
278 } 277 }
279 278
280 } // namespace views 279 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/widget_example.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698