OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |