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

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

Issue 11392004: Remove TabContents from AddBlankTabAt, kill AddBlankTab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2182 GdkEvent* event = gtk_get_current_event(); 2182 GdkEvent* event = gtk_get_current_event();
2183 DCHECK_EQ(event->type, GDK_BUTTON_RELEASE); 2183 DCHECK_EQ(event->type, GDK_BUTTON_RELEASE);
2184 int mouse_button = event->button.button; 2184 int mouse_button = event->button.button;
2185 gdk_event_free(event); 2185 gdk_event_free(event);
2186 2186
2187 switch (mouse_button) { 2187 switch (mouse_button) {
2188 case 1: 2188 case 1:
2189 content::RecordAction(UserMetricsAction("NewTab_Button")); 2189 content::RecordAction(UserMetricsAction("NewTab_Button"));
2190 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON, 2190 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON,
2191 TabStripModel::NEW_TAB_ENUM_COUNT); 2191 TabStripModel::NEW_TAB_ENUM_COUNT);
2192 model_->delegate()->AddBlankTab(true); 2192 model_->delegate()->AddBlankTabAt(-1, true);
2193 break; 2193 break;
2194 case 2: { 2194 case 2: {
2195 // On middle-click, try to parse the PRIMARY selection as a URL and load 2195 // On middle-click, try to parse the PRIMARY selection as a URL and load
2196 // it instead of creating a blank page. 2196 // it instead of creating a blank page.
2197 GURL url; 2197 GURL url;
2198 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url)) 2198 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url))
2199 return; 2199 return;
2200 2200
2201 Browser* browser = window_->browser(); 2201 Browser* browser = window_->browser();
2202 DCHECK(browser); 2202 DCHECK(browser);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 2268
2269 void TabStripGtk::SetNewTabButtonBackground() { 2269 void TabStripGtk::SetNewTabButtonBackground() {
2270 SkColor color = theme_service_->GetColor( 2270 SkColor color = theme_service_->GetColor(
2271 ThemeService::COLOR_BUTTON_BACKGROUND); 2271 ThemeService::COLOR_BUTTON_BACKGROUND);
2272 SkBitmap background = theme_service_->GetImageNamed( 2272 SkBitmap background = theme_service_->GetImageNamed(
2273 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); 2273 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap();
2274 SkBitmap mask = theme_service_->GetImageNamed( 2274 SkBitmap mask = theme_service_->GetImageNamed(
2275 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); 2275 IDR_NEWTAB_BUTTON_MASK).AsBitmap();
2276 newtab_button_->SetBackground(color, background, mask); 2276 newtab_button_->SetBackground(color, background, mask);
2277 } 2277 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/find_bar/find_bar_host_browsertest.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698