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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 154783002: Honor can_activate flag in ShowWindowWithState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 316fe3bc5f3969007763fe42b2d3895fae15d709..ad53709a78e04330f29b5469cd1adefe12d2b0ed 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -58,6 +58,7 @@ const int kSelectionHandleHorizPadding = 10;
const int kSelectionHandleVertPadding = 20;
const int kContextMenuTimoutMs = 200;
+bool g_open_quick_menu_immediately_for_test = false;
const int kSelectionHandleQuickFadeDurationMs = 50;
@@ -342,6 +343,12 @@ TouchSelectionControllerImpl::~TouchSelectionControllerImpl() {
client_widget_->RemoveObserver(this);
}
+// static
+void TouchSelectionControllerImpl::SetOpenQuickMenuImmediatelyForTest(
+ bool immediate) {
+ g_open_quick_menu_immediately_for_test = immediate;
+}
+
void TouchSelectionControllerImpl::SelectionChanged() {
gfx::Rect r1, r2;
client_view_->GetSelectionEndPoints(&r1, &r2);
@@ -580,6 +587,10 @@ void TouchSelectionControllerImpl::ContextMenuTimerFired() {
void TouchSelectionControllerImpl::StartContextMenuTimer() {
if (context_menu_timer_.IsRunning())
return;
+ if (g_open_quick_menu_immediately_for_test) {
+ ContextMenuTimerFired();
+ return;
+ }
context_menu_timer_.Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kContextMenuTimoutMs),

Powered by Google App Engine
This is Rietveld 408576698