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

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

Issue 74133003: linux-aura: Restore middle-click on new-tab button behaviour. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-nit Created 7 years, 1 month 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/gtk/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 GdkEvent* event = gtk_get_current_event(); 2178 GdkEvent* event = gtk_get_current_event();
2179 DCHECK_EQ(event->type, GDK_BUTTON_RELEASE); 2179 DCHECK_EQ(event->type, GDK_BUTTON_RELEASE);
2180 int mouse_button = event->button.button; 2180 int mouse_button = event->button.button;
2181 gdk_event_free(event); 2181 gdk_event_free(event);
2182 2182
2183 switch (mouse_button) { 2183 switch (mouse_button) {
2184 case 1: 2184 case 1:
2185 content::RecordAction(UserMetricsAction("NewTab_Button")); 2185 content::RecordAction(UserMetricsAction("NewTab_Button"));
2186 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON, 2186 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON,
2187 TabStripModel::NEW_TAB_ENUM_COUNT); 2187 TabStripModel::NEW_TAB_ENUM_COUNT);
2188 model_->delegate()->AddBlankTabAt(-1, true); 2188 model_->delegate()->AddURLTabAt(GURL(), -1, true);
2189 break; 2189 break;
2190 case 2: { 2190 case 2: {
2191 // On middle-click, try to parse the PRIMARY selection as a URL and load 2191 // On middle-click, try to parse the PRIMARY selection as a URL and load
2192 // it instead of creating a blank page. 2192 // it instead of creating a blank page.
2193 GURL url; 2193 GURL url;
2194 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url)) 2194 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url))
2195 return; 2195 return;
2196 2196
2197 Browser* browser = window_->browser(); 2197 Browser* browser = window_->browser();
2198 DCHECK(browser); 2198 DCHECK(browser);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 2265
2266 void TabStripGtk::SetNewTabButtonBackground() { 2266 void TabStripGtk::SetNewTabButtonBackground() {
2267 SkColor color = theme_service_->GetColor( 2267 SkColor color = theme_service_->GetColor(
2268 ThemeProperties::COLOR_BUTTON_BACKGROUND); 2268 ThemeProperties::COLOR_BUTTON_BACKGROUND);
2269 SkBitmap background = theme_service_->GetImageNamed( 2269 SkBitmap background = theme_service_->GetImageNamed(
2270 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); 2270 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap();
2271 SkBitmap mask = theme_service_->GetImageNamed( 2271 SkBitmap mask = theme_service_->GetImageNamed(
2272 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); 2272 IDR_NEWTAB_BUTTON_MASK).AsBitmap();
2273 newtab_button_->SetBackground(color, background, mask); 2273 newtab_button_->SetBackground(color, background, mask);
2274 } 2274 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698