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

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

Issue 7250001: Refactor the glib message-pump, and use it as the base for a gtk message pump and an X message pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dragged_tab_controller.h" 5 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 524 }
525 525
526 void DraggedTabController::DidProcessMessage(const MSG& msg) { 526 void DraggedTabController::DidProcessMessage(const MSG& msg) {
527 // If the user presses ESC during a drag, we need to abort and revert things 527 // If the user presses ESC during a drag, we need to abort and revert things
528 // to the way they were. This is the most reliable way to do this since no 528 // to the way they were. This is the most reliable way to do this since no
529 // single view or window reliably receives events throughout all the various 529 // single view or window reliably receives events throughout all the various
530 // kinds of tab dragging. 530 // kinds of tab dragging.
531 if (msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE) 531 if (msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE)
532 EndDrag(true); 532 EndDrag(true);
533 } 533 }
534 #elif defined(TOUCH_UI)
535 bool DraggedTabController::WillProcessXEvent(XEvent* xevent) {
536 return false;
537 }
534 #elif defined(TOOLKIT_USES_GTK) 538 #elif defined(TOOLKIT_USES_GTK)
535 void DraggedTabController::WillProcessEvent(GdkEvent* event) { 539 void DraggedTabController::WillProcessEvent(GdkEvent* event) {
536 } 540 }
537 541
538 void DraggedTabController::DidProcessEvent(GdkEvent* event) { 542 void DraggedTabController::DidProcessEvent(GdkEvent* event) {
539 if (event->type == GDK_KEY_PRESS && 543 if (event->type == GDK_KEY_PRESS &&
540 reinterpret_cast<GdkEventKey*>(event)->keyval == GDK_Escape) { 544 reinterpret_cast<GdkEventKey*>(event)->keyval == GDK_Escape) {
541 EndDrag(true); 545 EndDrag(true);
542 } 546 }
543 } 547 }
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 1444
1441 bool DraggedTabController::AreTabsConsecutive() { 1445 bool DraggedTabController::AreTabsConsecutive() {
1442 for (size_t i = 1; i < drag_data_.size(); ++i) { 1446 for (size_t i = 1; i < drag_data_.size(); ++i) {
1443 if (drag_data_[i - 1].source_model_index + 1 != 1447 if (drag_data_[i - 1].source_model_index + 1 !=
1444 drag_data_[i].source_model_index) { 1448 drag_data_[i].source_model_index) {
1445 return false; 1449 return false;
1446 } 1450 }
1447 } 1451 }
1448 return true; 1452 return true;
1449 } 1453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698