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

Side by Side Diff: ash/frame/caption_buttons/frame_size_button.cc

Issue 404213003: [WIP] Allow scroll events to permanently change the default gesture handler in RootView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: friend test Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.h » ('j') | chrome/browser/ui/views/tabs/tab.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/frame/caption_buttons/frame_size_button.h" 5 #include "ash/frame/caption_buttons/frame_size_button.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/screen_util.h" 8 #include "ash/screen_util.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/touch/touch_uma.h" 10 #include "ash/touch/touch_uma.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN || 114 if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
115 event->type() == ui::ET_GESTURE_SCROLL_UPDATE) { 115 event->type() == ui::ET_GESTURE_SCROLL_UPDATE) {
116 UpdateSnapType(*event); 116 UpdateSnapType(*event);
117 event->SetHandled(); 117 event->SetHandled();
118 return; 118 return;
119 } 119 }
120 120
121 if (event->type() == ui::ET_GESTURE_TAP || 121 if (event->type() == ui::ET_GESTURE_TAP ||
122 event->type() == ui::ET_GESTURE_SCROLL_END || 122 event->type() == ui::ET_GESTURE_SCROLL_END ||
123 event->type() == ui::ET_SCROLL_FLING_START || 123 event->type() == ui::ET_SCROLL_FLING_START) {
124 event->type() == ui::ET_GESTURE_END) {
tdresser 2014/07/24 18:17:22 This changes behavior, doesn't it? Are we ok with
sadrul 2014/07/24 19:12:13 Looks like the code starts doing things in respons
tdresser 2014/07/24 19:16:44 Shouldn't it also listen to LONG_TAP?
sadrul 2014/07/24 19:21:34 Good point. That will probably be necessary here,
tdanderson 2014/07/25 17:16:10 Thanks for pointing this out.
125 if (CommitSnap(*event)) { 124 if (CommitSnap(*event)) {
126 if (event->type() == ui::ET_GESTURE_TAP) { 125 if (event->type() == ui::ET_GESTURE_TAP) {
127 TouchUMA::GetInstance()->RecordGestureAction( 126 TouchUMA::GetInstance()->RecordGestureAction(
128 TouchUMA::GESTURE_FRAMEMAXIMIZE_TAP); 127 TouchUMA::GESTURE_FRAMEMAXIMIZE_TAP);
129 } 128 }
130 event->SetHandled(); 129 event->SetHandled();
131 return; 130 return;
132 } 131 }
133 } 132 }
134 133
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void FrameSizeButton::SetButtonsToNormalMode( 274 void FrameSizeButton::SetButtonsToNormalMode(
276 FrameSizeButtonDelegate::Animate animate) { 275 FrameSizeButtonDelegate::Animate animate) {
277 in_snap_mode_ = false; 276 in_snap_mode_ = false;
278 snap_type_ = SNAP_NONE; 277 snap_type_ = SNAP_NONE;
279 set_buttons_to_snap_mode_timer_.Stop(); 278 set_buttons_to_snap_mode_timer_.Stop();
280 delegate_->SetButtonsToNormal(animate); 279 delegate_->SetButtonsToNormal(animate);
281 phantom_window_controller_.reset(); 280 phantom_window_controller_.reset();
282 } 281 }
283 282
284 } // namespace ash 283 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.h » ('j') | chrome/browser/ui/views/tabs/tab.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698