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

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

Issue 10337010: Revert r123782. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | chrome/browser/ui/gtk/task_manager_gtk.cc » ('j') | 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) 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 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/debug/trace_event.h" 12 #include "base/debug/trace_event.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "chrome/browser/autocomplete/autocomplete.h" 16 #include "chrome/browser/autocomplete/autocomplete.h"
17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
18 #include "chrome/browser/autocomplete/autocomplete_match.h" 18 #include "chrome/browser/autocomplete/autocomplete_match.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/tabs/tab_strip_model_delegate.h" 20 #include "chrome/browser/tabs/tab_strip_model_delegate.h"
21 #include "chrome/browser/themes/theme_service.h" 21 #include "chrome/browser/themes/theme_service.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_navigator.h" 23 #include "chrome/browser/ui/browser_navigator.h"
24 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 24 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
25 #include "chrome/browser/ui/gtk/custom_button.h" 25 #include "chrome/browser/ui/gtk/custom_button.h"
26 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
26 #include "chrome/browser/ui/gtk/gtk_util.h" 27 #include "chrome/browser/ui/gtk/gtk_util.h"
27 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" 28 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h"
28 #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h" 29 #include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h"
29 #include "chrome/browser/ui/gtk/theme_service_gtk.h"
30 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 30 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
31 #include "chrome/common/chrome_notification_types.h" 31 #include "chrome/common/chrome_notification_types.h"
32 #include "content/public/browser/notification_source.h" 32 #include "content/public/browser/notification_source.h"
33 #include "content/public/browser/web_contents.h" 33 #include "content/public/browser/web_contents.h"
34 #include "grit/generated_resources.h" 34 #include "grit/generated_resources.h"
35 #include "grit/theme_resources.h" 35 #include "grit/theme_resources.h"
36 #include "grit/theme_resources_standard.h" 36 #include "grit/theme_resources_standard.h"
37 #include "grit/ui_resources.h" 37 #include "grit/ui_resources.h"
38 #include "ui/base/animation/animation_delegate.h" 38 #include "ui/base/animation/animation_delegate.h"
39 #include "ui/base/animation/slide_animation.h" 39 #include "ui/base/animation/slide_animation.h"
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 const int TabStripGtk::mini_to_non_mini_gap_ = 3; 709 const int TabStripGtk::mini_to_non_mini_gap_ = 3;
710 710
711 TabStripGtk::TabStripGtk(TabStripModel* model, BrowserWindowGtk* window) 711 TabStripGtk::TabStripGtk(TabStripModel* model, BrowserWindowGtk* window)
712 : current_unselected_width_(TabGtk::GetStandardSize().width()), 712 : current_unselected_width_(TabGtk::GetStandardSize().width()),
713 current_selected_width_(TabGtk::GetStandardSize().width()), 713 current_selected_width_(TabGtk::GetStandardSize().width()),
714 available_width_for_tabs_(-1), 714 available_width_for_tabs_(-1),
715 needs_resize_layout_(false), 715 needs_resize_layout_(false),
716 tab_vertical_offset_(0), 716 tab_vertical_offset_(0),
717 model_(model), 717 model_(model),
718 window_(window), 718 window_(window),
719 theme_service_(ThemeServiceGtk::GetFrom(model->profile())), 719 theme_service_(GtkThemeService::GetFrom(model->profile())),
720 weak_factory_(this), 720 weak_factory_(this),
721 layout_factory_(this), 721 layout_factory_(this),
722 added_as_message_loop_observer_(false), 722 added_as_message_loop_observer_(false),
723 hover_tab_selector_(model) { 723 hover_tab_selector_(model) {
724 } 724 }
725 725
726 TabStripGtk::~TabStripGtk() { 726 TabStripGtk::~TabStripGtk() {
727 model_->RemoveObserver(this); 727 model_->RemoveObserver(this);
728 tabstrip_.Destroy(); 728 tabstrip_.Destroy();
729 729
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 } 1293 }
1294 1294
1295 bool TabStripGtk::EndDrag(bool canceled) { 1295 bool TabStripGtk::EndDrag(bool canceled) {
1296 return drag_controller_.get() ? drag_controller_->EndDrag(canceled) : false; 1296 return drag_controller_.get() ? drag_controller_->EndDrag(canceled) : false;
1297 } 1297 }
1298 1298
1299 bool TabStripGtk::HasAvailableDragActions() const { 1299 bool TabStripGtk::HasAvailableDragActions() const {
1300 return model_->delegate()->GetDragActions() != 0; 1300 return model_->delegate()->GetDragActions() != 0;
1301 } 1301 }
1302 1302
1303 ThemeServiceGtk* TabStripGtk::GetThemeProvider() { 1303 GtkThemeService* TabStripGtk::GetThemeProvider() {
1304 return theme_service_; 1304 return theme_service_;
1305 } 1305 }
1306 1306
1307 TabStripMenuController* TabStripGtk::GetTabStripMenuControllerForTab( 1307 TabStripMenuController* TabStripGtk::GetTabStripMenuControllerForTab(
1308 TabGtk* tab) { 1308 TabGtk* tab) {
1309 return new TabStripMenuController(tab, model(), GetIndexOfTab(tab)); 1309 return new TabStripMenuController(tab, model(), GetIndexOfTab(tab));
1310 } 1310 }
1311 1311
1312 /////////////////////////////////////////////////////////////////////////////// 1312 ///////////////////////////////////////////////////////////////////////////////
1313 // TabStripGtk, MessageLoop::Observer implementation: 1313 // TabStripGtk, MessageLoop::Observer implementation:
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 } 2257 }
2258 2258
2259 void TabStripGtk::SetNewTabButtonBackground() { 2259 void TabStripGtk::SetNewTabButtonBackground() {
2260 SkColor color = theme_service_->GetColor( 2260 SkColor color = theme_service_->GetColor(
2261 ThemeService::COLOR_BUTTON_BACKGROUND); 2261 ThemeService::COLOR_BUTTON_BACKGROUND);
2262 SkBitmap* background = theme_service_->GetBitmapNamed( 2262 SkBitmap* background = theme_service_->GetBitmapNamed(
2263 IDR_THEME_WINDOW_CONTROL_BACKGROUND); 2263 IDR_THEME_WINDOW_CONTROL_BACKGROUND);
2264 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); 2264 SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK);
2265 newtab_button_->SetBackground(color, background, mask); 2265 newtab_button_->SetBackground(color, background, mask);
2266 } 2266 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | chrome/browser/ui/gtk/task_manager_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698