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

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

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 SetAnchorRect(adjusted_anchor_rect); 133 SetAnchorRect(adjusted_anchor_rect);
134 134
135 BubbleDelegateView::CreateBubble(this); 135 BubbleDelegateView::CreateBubble(this);
136 GetWidget()->Show(); 136 GetWidget()->Show();
137 } 137 }
138 138
139 TouchSelectionMenuRunnerViews::Menu::~Menu() { 139 TouchSelectionMenuRunnerViews::Menu::~Menu() {
140 } 140 }
141 141
142 void TouchSelectionMenuRunnerViews::Menu::CreateButtons() { 142 void TouchSelectionMenuRunnerViews::Menu::CreateButtons() {
143 #if defined(OS_ANDROID)
144 if (!client_)
145 return;
146 #endif
143 for (size_t i = 0; i < arraysize(kMenuCommands); i++) { 147 for (size_t i = 0; i < arraysize(kMenuCommands); i++) {
144 int command_id = kMenuCommands[i]; 148 int command_id = kMenuCommands[i];
145 if (!client_->IsCommandIdEnabled(command_id)) 149 if (!client_->IsCommandIdEnabled(command_id))
146 continue; 150 continue;
147 151
148 Button* button = 152 Button* button =
149 CreateButton(l10n_util::GetStringUTF16(command_id), command_id); 153 CreateButton(l10n_util::GetStringUTF16(command_id), command_id);
150 AddChildView(button); 154 AddChildView(button);
151 } 155 }
152 156
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Closing the menu will eventually delete the object. 244 // Closing the menu will eventually delete the object.
241 menu_->Close(); 245 menu_->Close();
242 menu_ = nullptr; 246 menu_ = nullptr;
243 } 247 }
244 248
245 bool TouchSelectionMenuRunnerViews::IsRunning() const { 249 bool TouchSelectionMenuRunnerViews::IsRunning() const {
246 return menu_ != nullptr; 250 return menu_ != nullptr;
247 } 251 }
248 252
249 } // namespace views 253 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698