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

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

Issue 10702029: Move tab functions off Browser into browser_tabstrip and browser_tabrestore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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/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>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/debug/trace_event.h" 13 #include "base/debug/trace_event.h"
14 #include "base/i18n/rtl.h" 14 #include "base/i18n/rtl.h"
15 #include "base/metrics/histogram.h" 15 #include "base/metrics/histogram.h"
16 #include "base/string_util.h" 16 #include "base/string_util.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "chrome/browser/autocomplete/autocomplete.h" 18 #include "chrome/browser/autocomplete/autocomplete.h"
19 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 19 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
20 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 20 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
21 #include "chrome/browser/autocomplete/autocomplete_match.h" 21 #include "chrome/browser/autocomplete/autocomplete_match.h"
22 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/themes/theme_service.h" 23 #include "chrome/browser/themes/theme_service.h"
24 #include "chrome/browser/ui/browser.h" 24 #include "chrome/browser/ui/browser.h"
25 #include "chrome/browser/ui/browser_navigator.h" 25 #include "chrome/browser/ui/browser_navigator.h"
26 #include "chrome/browser/ui/browser_tabstrip.h"
26 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 27 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
27 #include "chrome/browser/ui/gtk/custom_button.h" 28 #include "chrome/browser/ui/gtk/custom_button.h"
28 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 29 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
29 #include "chrome/browser/ui/gtk/gtk_util.h" 30 #include "chrome/browser/ui/gtk/gtk_util.h"
30 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" 31 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h"
31 #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h" 32 #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h"
32 #include "chrome/browser/ui/tabs/tab_strip_model.h" 33 #include "chrome/browser/ui/tabs/tab_strip_model.h"
33 #include "chrome/browser/ui/tab_contents/tab_contents.h" 34 #include "chrome/browser/ui/tab_contents/tab_contents.h"
34 #include "chrome/common/chrome_notification_types.h" 35 #include "chrome/common/chrome_notification_types.h"
35 #include "content/public/browser/notification_source.h" 36 #include "content/public/browser/notification_source.h"
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 break; 2192 break;
2192 case 2: { 2193 case 2: {
2193 // On middle-click, try to parse the PRIMARY selection as a URL and load 2194 // On middle-click, try to parse the PRIMARY selection as a URL and load
2194 // it instead of creating a blank page. 2195 // it instead of creating a blank page.
2195 GURL url; 2196 GURL url;
2196 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url)) 2197 if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url))
2197 return; 2198 return;
2198 2199
2199 Browser* browser = window_->browser(); 2200 Browser* browser = window_->browser();
2200 DCHECK(browser); 2201 DCHECK(browser);
2201 browser->AddSelectedTabWithURL(url, content::PAGE_TRANSITION_TYPED); 2202 chrome::AddSelectedTabWithURL(browser, url, content::PAGE_TRANSITION_TYPED );
2202 break; 2203 break;
2203 } 2204 }
2204 default: 2205 default:
2205 NOTREACHED() << "Got click on new tab button with unhandled mouse " 2206 NOTREACHED() << "Got click on new tab button with unhandled mouse "
2206 << "button " << mouse_button; 2207 << "button " << mouse_button;
2207 } 2208 }
2208 } 2209 }
2209 2210
2210 void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { 2211 void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) {
2211 gfx::Rect bds = bounds; 2212 gfx::Rect bds = bounds;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 } 2266 }
2266 2267
2267 void TabStripGtk::SetNewTabButtonBackground() { 2268 void TabStripGtk::SetNewTabButtonBackground() {
2268 SkColor color = theme_service_->GetColor( 2269 SkColor color = theme_service_->GetColor(
2269 ThemeService::COLOR_BUTTON_BACKGROUND); 2270 ThemeService::COLOR_BUTTON_BACKGROUND);
2270 SkBitmap* background = theme_service_->GetBitmapNamed( 2271 SkBitmap* background = theme_service_->GetBitmapNamed(
2271 IDR_THEME_WINDOW_CONTROL_BACKGROUND); 2272 IDR_THEME_WINDOW_CONTROL_BACKGROUND);
2272 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); 2273 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK);
2273 newtab_button_->SetBackground(color, background, mask); 2274 newtab_button_->SetBackground(color, background, mask);
2274 } 2275 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc ('k') | chrome/browser/ui/intents/web_intent_inline_disposition_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698