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

Side by Side Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 118127: Allow left clicks in the tab strip to initiate a drag of the window. (Closed)
Patch Set: Created 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gtk/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "app/slide_animation.h" 10 #include "app/slide_animation.h"
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 // reproduce this behavior. 1086 // reproduce this behavior.
1087 if (tabstrip->GetTabCount() == 1) 1087 if (tabstrip->GetTabCount() == 1)
1088 tabstrip->Layout(); 1088 tabstrip->Layout();
1089 else 1089 else
1090 tabstrip->ResizeLayoutTabs(); 1090 tabstrip->ResizeLayoutTabs();
1091 } 1091 }
1092 1092
1093 // static 1093 // static
1094 gboolean TabStripGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event, 1094 gboolean TabStripGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event,
1095 TabStripGtk* tabstrip) { 1095 TabStripGtk* tabstrip) {
1096 if (3 == event->button) 1096 if (1 == event->button) {
1097 gtk_window_begin_move_drag(GTK_WINDOW(gtk_widget_get_toplevel(widget)),
1098 event->button, event->x_root, event->y_root, event->time);
1099 } else if (3 == event->button) {
1097 tabstrip->ShowContextMenu(); 1100 tabstrip->ShowContextMenu();
1101 }
1098 1102
1099 return TRUE; 1103 return TRUE;
1100 } 1104 }
1101 1105
1102 // static 1106 // static
1103 void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) { 1107 void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) {
1104 tabstrip->model_->delegate()->AddBlankTab(true); 1108 tabstrip->model_->delegate()->AddBlankTab(true);
1105 } 1109 }
1106 1110
1107 void TabStripGtk::PaintBackground(GdkEventExpose* event) { 1111 void TabStripGtk::PaintBackground(GdkEventExpose* event) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1181
1178 case TabStripModel::CommandTaskManager: 1182 case TabStripModel::CommandTaskManager:
1179 // TODO(tc): This needs to be implemented in the TabStripModelDelegate. 1183 // TODO(tc): This needs to be implemented in the TabStripModelDelegate.
1180 NOTIMPLEMENTED(); 1184 NOTIMPLEMENTED();
1181 break; 1185 break;
1182 1186
1183 default: 1187 default:
1184 NOTREACHED(); 1188 NOTREACHED();
1185 } 1189 }
1186 } 1190 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698