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

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

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased 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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Layout(); 153 Layout();
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->SetFocusBehavior(FocusBehavior::ALWAYS); 163 Button::ConfigureDefaultFocus(button);
164 button->set_request_focus_on_press(false); 164 button->set_request_focus_on_press(false);
165 const gfx::FontList& font_list = 165 const gfx::FontList& font_list =
166 ui::ResourceBundle::GetSharedInstance().GetFontList( 166 ui::ResourceBundle::GetSharedInstance().GetFontList(
167 ui::ResourceBundle::SmallFont); 167 ui::ResourceBundle::SmallFont);
168 button->SetFontList(font_list); 168 button->SetFontList(font_list);
169 button->SetHorizontalAlignment(gfx::ALIGN_CENTER); 169 button->SetHorizontalAlignment(gfx::ALIGN_CENTER);
170 button->set_tag(tag); 170 button->set_tag(tag);
171 return button; 171 return button;
172 } 172 }
173 173
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // Closing the menu sets |menu_| to nullptr and eventually deletes the object. 271 // Closing the menu sets |menu_| to nullptr and eventually deletes the object.
272 menu_->CloseMenu(); 272 menu_->CloseMenu();
273 DCHECK(!menu_); 273 DCHECK(!menu_);
274 } 274 }
275 275
276 bool TouchSelectionMenuRunnerViews::IsRunning() const { 276 bool TouchSelectionMenuRunnerViews::IsRunning() const {
277 return menu_ != nullptr; 277 return menu_ != nullptr;
278 } 278 }
279 279
280 } // namespace views 280 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698