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

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"
11 #include "chrome/browser/ui/gtk/gtk_util.h" 11 #include "chrome/browser/ui/gtk/gtk_util.h"
12 #include "chrome/common/chrome_notification_types.h"
12 #include "content/common/notification_service.h" 13 #include "content/common/notification_service.h"
13 #include "grit/generated_resources.h" 14 #include "grit/generated_resources.h"
14 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
15 16
16 BookmarkBarInstructionsGtk::BookmarkBarInstructionsGtk(Delegate* delegate, 17 BookmarkBarInstructionsGtk::BookmarkBarInstructionsGtk(Delegate* delegate,
17 Profile* profile) 18 Profile* profile)
18 : delegate_(delegate), 19 : delegate_(delegate),
19 profile_(profile), 20 profile_(profile),
20 theme_service_(GtkThemeService::GetFrom(profile_)) { 21 theme_service_(GtkThemeService::GetFrom(profile_)) {
21 instructions_hbox_ = gtk_chrome_shrinkable_hbox_new(FALSE, FALSE, 0); 22 instructions_hbox_ = gtk_chrome_shrinkable_hbox_new(FALSE, FALSE, 0);
(...skipping 18 matching lines...) Expand all
40 // Until we switch to vector graphics, force the font size. 41 // Until we switch to vector graphics, force the font size.
41 // 13.4px == 10pt @ 96dpi 42 // 13.4px == 10pt @ 96dpi
42 gtk_util::ForceFontSizePixels( 43 gtk_util::ForceFontSizePixels(
43 GTK_CHROME_LINK_BUTTON(instructions_link_)->label, 13.4); 44 GTK_CHROME_LINK_BUTTON(instructions_link_)->label, 13.4);
44 gtk_util::CenterWidgetInHBox(instructions_hbox_, instructions_link_, 45 gtk_util::CenterWidgetInHBox(instructions_hbox_, instructions_link_,
45 false, 6); 46 false, 6);
46 g_signal_connect(GTK_CHROME_LINK_BUTTON(instructions_link_)->label, "map", 47 g_signal_connect(GTK_CHROME_LINK_BUTTON(instructions_link_)->label, "map",
47 G_CALLBACK(gtk_util::InitLabelSizeRequestAndEllipsizeMode), 48 G_CALLBACK(gtk_util::InitLabelSizeRequestAndEllipsizeMode),
48 NULL); 49 NULL);
49 50
50 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 51 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
51 Source<ThemeService>(theme_service_)); 52 Source<ThemeService>(theme_service_));
52 theme_service_->InitThemesFor(this); 53 theme_service_->InitThemesFor(this);
53 } 54 }
54 55
55 void BookmarkBarInstructionsGtk::Observe(NotificationType type, 56 void BookmarkBarInstructionsGtk::Observe(int type,
56 const NotificationSource& source, 57 const NotificationSource& source,
57 const NotificationDetails& details) { 58 const NotificationDetails& details) {
58 if (type == NotificationType::BROWSER_THEME_CHANGED) 59 if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED)
59 UpdateColors(); 60 UpdateColors();
60 } 61 }
61 62
62 void BookmarkBarInstructionsGtk::OnButtonClick(GtkWidget* button) { 63 void BookmarkBarInstructionsGtk::OnButtonClick(GtkWidget* button) {
63 delegate_->ShowImportDialog(); 64 delegate_->ShowImportDialog();
64 } 65 }
65 66
66 void BookmarkBarInstructionsGtk::UpdateColors() { 67 void BookmarkBarInstructionsGtk::UpdateColors() {
67 GdkColor bookmark_color = theme_service_->GetGdkColor( 68 GdkColor bookmark_color = theme_service_->GetGdkColor(
68 ThemeService::COLOR_BOOKMARK_TEXT); 69 ThemeService::COLOR_BOOKMARK_TEXT);
(...skipping 11 matching lines...) Expand all
80 ThemeService::GetDefaultColor( 81 ThemeService::GetDefaultColor(
81 ThemeService::COLOR_BOOKMARK_TEXT)) { 82 ThemeService::COLOR_BOOKMARK_TEXT)) {
82 gtk_chrome_link_button_set_normal_color( 83 gtk_chrome_link_button_set_normal_color(
83 GTK_CHROME_LINK_BUTTON(instructions_link_), NULL); 84 GTK_CHROME_LINK_BUTTON(instructions_link_), NULL);
84 } else { 85 } else {
85 gtk_chrome_link_button_set_normal_color( 86 gtk_chrome_link_button_set_normal_color(
86 GTK_CHROME_LINK_BUTTON(instructions_link_), &bookmark_color); 87 GTK_CHROME_LINK_BUTTON(instructions_link_), &bookmark_color);
87 } 88 }
88 } 89 }
89 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698