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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 223483002: base: Do not allow MessagePumpObservers to consume events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r262009 Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/tabs/tab_drag_controller.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 return; 486 return;
487 } 487 }
488 } 488 }
489 // If we get here it means we got notification for a tab we don't know about. 489 // If we get here it means we got notification for a tab we don't know about.
490 NOTREACHED(); 490 NOTREACHED();
491 } 491 }
492 492
493 /////////////////////////////////////////////////////////////////////////////// 493 ///////////////////////////////////////////////////////////////////////////////
494 // TabDragController, MessageLoop::Observer implementation: 494 // TabDragController, MessageLoop::Observer implementation:
495 495
496 base::EventStatus TabDragController::WillProcessEvent( 496 void TabDragController::WillProcessEvent(const base::NativeEvent& event) {}
497 const base::NativeEvent& event) {
498 return base::EVENT_CONTINUE;
499 }
500 497
501 void TabDragController::DidProcessEvent(const base::NativeEvent& event) { 498 void TabDragController::DidProcessEvent(const base::NativeEvent& event) {
502 // If the user presses ESC during a drag, we need to abort and revert things 499 // If the user presses ESC during a drag, we need to abort and revert things
503 // to the way they were. This is the most reliable way to do this since no 500 // to the way they were. This is the most reliable way to do this since no
504 // single view or window reliably receives events throughout all the various 501 // single view or window reliably receives events throughout all the various
505 // kinds of tab dragging. 502 // kinds of tab dragging.
506 if (ui::EventTypeFromNative(event) == ui::ET_KEY_PRESSED && 503 if (ui::EventTypeFromNative(event) == ui::ET_KEY_PRESSED &&
507 ui::KeyboardCodeFromNative(event) == ui::VKEY_ESCAPE) { 504 ui::KeyboardCodeFromNative(event) == ui::VKEY_ESCAPE) {
508 EndDrag(END_DRAG_CANCEL); 505 EndDrag(END_DRAG_CANCEL);
509 } 506 }
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 it != browser_list->end(); ++it) { 1919 it != browser_list->end(); ++it) {
1923 if ((*it)->tab_strip_model()->empty()) 1920 if ((*it)->tab_strip_model()->empty())
1924 exclude.insert((*it)->window()->GetNativeWindow()); 1921 exclude.insert((*it)->window()->GetNativeWindow());
1925 } 1922 }
1926 #endif 1923 #endif
1927 return GetLocalProcessWindowAtPoint(host_desktop_type_, 1924 return GetLocalProcessWindowAtPoint(host_desktop_type_,
1928 screen_point, 1925 screen_point,
1929 exclude); 1926 exclude);
1930 1927
1931 } 1928 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.h ('k') | ui/aura/device_list_updater_aurax11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698