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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_instructions_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h"
6 6
7 #include "base/observer_list.h" 7 #include "base/observer_list.h"
8 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" 8 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h"
9 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" 9 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h"
10 #include "chrome/browser/ui/gtk/gtk_theme_service.h" 10 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
(...skipping 29 matching lines...) Expand all
40 // Until we switch to vector graphics, force the font size. 40 // Until we switch to vector graphics, force the font size.
41 // 13.4px == 10pt @ 96dpi 41 // 13.4px == 10pt @ 96dpi
42 gtk_util::ForceFontSizePixels( 42 gtk_util::ForceFontSizePixels(
43 GTK_CHROME_LINK_BUTTON(instructions_link_)->label, 13.4); 43 GTK_CHROME_LINK_BUTTON(instructions_link_)->label, 13.4);
44 gtk_util::CenterWidgetInHBox(instructions_hbox_, instructions_link_, 44 gtk_util::CenterWidgetInHBox(instructions_hbox_, instructions_link_,
45 false, 6); 45 false, 6);
46 g_signal_connect(GTK_CHROME_LINK_BUTTON(instructions_link_)->label, "map", 46 g_signal_connect(GTK_CHROME_LINK_BUTTON(instructions_link_)->label, "map",
47 G_CALLBACK(gtk_util::InitLabelSizeRequestAndEllipsizeMode), 47 G_CALLBACK(gtk_util::InitLabelSizeRequestAndEllipsizeMode),
48 NULL); 48 NULL);
49 49
50 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 50 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
51 Source<ThemeService>(theme_service_)); 51 Source<ThemeService>(theme_service_));
52 theme_service_->InitThemesFor(this); 52 theme_service_->InitThemesFor(this);
53 } 53 }
54 54
55 void BookmarkBarInstructionsGtk::Observe(NotificationType type, 55 void BookmarkBarInstructionsGtk::Observe(int type,
56 const NotificationSource& source, 56 const NotificationSource& source,
57 const NotificationDetails& details) { 57 const NotificationDetails& details) {
58 if (type == NotificationType::BROWSER_THEME_CHANGED) 58 if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED)
59 UpdateColors(); 59 UpdateColors();
60 } 60 }
61 61
62 void BookmarkBarInstructionsGtk::OnButtonClick(GtkWidget* button) { 62 void BookmarkBarInstructionsGtk::OnButtonClick(GtkWidget* button) {
63 delegate_->ShowImportDialog(); 63 delegate_->ShowImportDialog();
64 } 64 }
65 65
66 void BookmarkBarInstructionsGtk::UpdateColors() { 66 void BookmarkBarInstructionsGtk::UpdateColors() {
67 GdkColor bookmark_color = theme_service_->GetGdkColor( 67 GdkColor bookmark_color = theme_service_->GetGdkColor(
68 ThemeService::COLOR_BOOKMARK_TEXT); 68 ThemeService::COLOR_BOOKMARK_TEXT);
(...skipping 11 matching lines...) Expand all
80 ThemeService::GetDefaultColor( 80 ThemeService::GetDefaultColor(
81 ThemeService::COLOR_BOOKMARK_TEXT)) { 81 ThemeService::COLOR_BOOKMARK_TEXT)) {
82 gtk_chrome_link_button_set_normal_color( 82 gtk_chrome_link_button_set_normal_color(
83 GTK_CHROME_LINK_BUTTON(instructions_link_), NULL); 83 GTK_CHROME_LINK_BUTTON(instructions_link_), NULL);
84 } else { 84 } else {
85 gtk_chrome_link_button_set_normal_color( 85 gtk_chrome_link_button_set_normal_color(
86 GTK_CHROME_LINK_BUTTON(instructions_link_), &bookmark_color); 86 GTK_CHROME_LINK_BUTTON(instructions_link_), &bookmark_color);
87 } 87 }
88 } 88 }
89 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698