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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc

Issue 9447096: gtk: Rename GtkThemeService to ThemeServiceGtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/bookmarks/bookmark_bar_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/bookmarks/bookmark_model.h" 13 #include "chrome/browser/bookmarks/bookmark_model.h"
14 #include "chrome/browser/bookmarks/bookmark_node_data.h" 14 #include "chrome/browser/bookmarks/bookmark_node_data.h"
15 #include "chrome/browser/bookmarks/bookmark_utils.h" 15 #include "chrome/browser/bookmarks/bookmark_utils.h"
16 #include "chrome/browser/browser_shutdown.h" 16 #include "chrome/browser/browser_shutdown.h"
17 #include "chrome/browser/extensions/extension_service.h" 17 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/ntp_background_util.h" 18 #include "chrome/browser/ntp_background_util.h"
19 #include "chrome/browser/prefs/pref_service.h" 19 #include "chrome/browser/prefs/pref_service.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
22 #include "chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h" 22 #include "chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h"
23 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" 23 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.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_chrome_button.h" 26 #include "chrome/browser/ui/gtk/gtk_chrome_button.h"
27 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
28 #include "chrome/browser/ui/gtk/gtk_util.h" 27 #include "chrome/browser/ui/gtk/gtk_util.h"
29 #include "chrome/browser/ui/gtk/hover_controller_gtk.h" 28 #include "chrome/browser/ui/gtk/hover_controller_gtk.h"
30 #include "chrome/browser/ui/gtk/menu_gtk.h" 29 #include "chrome/browser/ui/gtk/menu_gtk.h"
31 #include "chrome/browser/ui/gtk/rounded_window.h" 30 #include "chrome/browser/ui/gtk/rounded_window.h"
32 #include "chrome/browser/ui/gtk/tabstrip_origin_provider.h" 31 #include "chrome/browser/ui/gtk/tabstrip_origin_provider.h"
32 #include "chrome/browser/ui/gtk/theme_service_gtk.h"
33 #include "chrome/browser/ui/gtk/view_id_util.h" 33 #include "chrome/browser/ui/gtk/view_id_util.h"
34 #include "chrome/common/chrome_notification_types.h" 34 #include "chrome/common/chrome_notification_types.h"
35 #include "chrome/common/extensions/extension_constants.h" 35 #include "chrome/common/extensions/extension_constants.h"
36 #include "chrome/common/pref_names.h" 36 #include "chrome/common/pref_names.h"
37 #include "content/public/browser/notification_details.h" 37 #include "content/public/browser/notification_details.h"
38 #include "content/public/browser/notification_source.h" 38 #include "content/public/browser/notification_source.h"
39 #include "content/public/browser/user_metrics.h" 39 #include "content/public/browser/user_metrics.h"
40 #include "content/public/browser/web_contents.h" 40 #include "content/public/browser/web_contents.h"
41 #include "content/public/browser/web_contents_view.h" 41 #include "content/public/browser/web_contents_view.h"
42 #include "grit/generated_resources.h" 42 #include "grit/generated_resources.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 TabstripOriginProvider* tabstrip_origin_provider) 133 TabstripOriginProvider* tabstrip_origin_provider)
134 : page_navigator_(NULL), 134 : page_navigator_(NULL),
135 browser_(browser), 135 browser_(browser),
136 window_(window), 136 window_(window),
137 tabstrip_origin_provider_(tabstrip_origin_provider), 137 tabstrip_origin_provider_(tabstrip_origin_provider),
138 model_(NULL), 138 model_(NULL),
139 instructions_(NULL), 139 instructions_(NULL),
140 dragged_node_(NULL), 140 dragged_node_(NULL),
141 drag_icon_(NULL), 141 drag_icon_(NULL),
142 toolbar_drop_item_(NULL), 142 toolbar_drop_item_(NULL),
143 theme_service_(GtkThemeService::GetFrom(browser->profile())), 143 theme_service_(ThemeServiceGtk::GetFrom(browser->profile())),
144 show_instructions_(true), 144 show_instructions_(true),
145 menu_bar_helper_(this), 145 menu_bar_helper_(this),
146 slide_animation_(this), 146 slide_animation_(this),
147 last_allocation_width_(-1), 147 last_allocation_width_(-1),
148 throbbing_widget_(NULL), 148 throbbing_widget_(NULL),
149 weak_factory_(this), 149 weak_factory_(this),
150 bookmark_bar_state_(BookmarkBar::DETACHED), 150 bookmark_bar_state_(BookmarkBar::DETACHED),
151 max_height_(0) { 151 max_height_(0) {
152 Init(); 152 Init();
153 // Force an update by simulating being in the wrong state. 153 // Force an update by simulating being in the wrong state.
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 } 1374 }
1375 1375
1376 // Remove previous highlighting. 1376 // Remove previous highlighting.
1377 gtk_drag_unhighlight(button); 1377 gtk_drag_unhighlight(button);
1378 return ItemDraggedOverToolbar(context, index, time); 1378 return ItemDraggedOverToolbar(context, index, time);
1379 } 1379 }
1380 1380
1381 gboolean BookmarkBarGtk::OnEventBoxExpose(GtkWidget* widget, 1381 gboolean BookmarkBarGtk::OnEventBoxExpose(GtkWidget* widget,
1382 GdkEventExpose* event) { 1382 GdkEventExpose* event) {
1383 TRACE_EVENT0("ui::gtk", "BookmarkBarGtk::OnEventBoxExpose"); 1383 TRACE_EVENT0("ui::gtk", "BookmarkBarGtk::OnEventBoxExpose");
1384 GtkThemeService* theme_provider = theme_service_; 1384 ThemeServiceGtk* theme_provider = theme_service_;
1385 1385
1386 // We don't need to render the toolbar image in GTK mode, except when 1386 // We don't need to render the toolbar image in GTK mode, except when
1387 // detached. 1387 // detached.
1388 if (theme_provider->UsingNativeTheme() && 1388 if (theme_provider->UsingNativeTheme() &&
1389 bookmark_bar_state_ != BookmarkBar::DETACHED) 1389 bookmark_bar_state_ != BookmarkBar::DETACHED)
1390 return FALSE; 1390 return FALSE;
1391 1391
1392 if (bookmark_bar_state_ != BookmarkBar::DETACHED) { 1392 if (bookmark_bar_state_ != BookmarkBar::DETACHED) {
1393 cairo_t* cr = gdk_cairo_create(gtk_widget_get_window(widget)); 1393 cairo_t* cr = gdk_cairo_create(gtk_widget_get_window(widget));
1394 gdk_cairo_rectangle(cr, &event->area); 1394 gdk_cairo_rectangle(cr, &event->area);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { 1450 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() {
1451 GtkDestDefaults dest_defaults = 1451 GtkDestDefaults dest_defaults =
1452 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : 1452 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL :
1453 GTK_DEST_DEFAULT_DROP; 1453 GTK_DEST_DEFAULT_DROP;
1454 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); 1454 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction);
1455 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, 1455 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults,
1456 NULL, 0, kDragAction); 1456 NULL, 0, kDragAction);
1457 ui::SetDestTargetList(overflow_button_, kDestTargetList); 1457 ui::SetDestTargetList(overflow_button_, kDestTargetList);
1458 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); 1458 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList);
1459 } 1459 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698