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

Side by Side Diff: chrome/browser/ui/gtk/browser_titlebar.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/browser_titlebar.h" 5 #include "chrome/browser/ui/gtk/browser_titlebar.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 app_mode_title_ = gtk_label_new(NULL); 395 app_mode_title_ = gtk_label_new(NULL);
396 gtk_label_set_ellipsize(GTK_LABEL(app_mode_title_), PANGO_ELLIPSIZE_END); 396 gtk_label_set_ellipsize(GTK_LABEL(app_mode_title_), PANGO_ELLIPSIZE_END);
397 gtk_misc_set_alignment(GTK_MISC(app_mode_title_), 0.0, 0.5); 397 gtk_misc_set_alignment(GTK_MISC(app_mode_title_), 0.0, 0.5);
398 gtk_box_pack_start(GTK_BOX(app_mode_hbox), app_mode_title_, TRUE, TRUE, 398 gtk_box_pack_start(GTK_BOX(app_mode_hbox), app_mode_title_, TRUE, TRUE,
399 0); 399 0);
400 400
401 // Register with the theme provider to set the |app_mode_title_| label 401 // Register with the theme provider to set the |app_mode_title_| label
402 // color. 402 // color.
403 theme_service_ = GtkThemeService::GetFrom( 403 theme_service_ = GtkThemeService::GetFrom(
404 browser_window_->browser()->profile()); 404 browser_window_->browser()->profile());
405 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 405 registrar_.Add(this, chrome::BROWSER_THEME_CHANGED,
406 Source<ThemeService>(theme_service_)); 406 Source<ThemeService>(theme_service_));
407 theme_service_->InitThemesFor(this); 407 theme_service_->InitThemesFor(this);
408 UpdateTitleAndIcon(); 408 UpdateTitleAndIcon();
409 } 409 }
410 410
411 gtk_widget_show_all(container_); 411 gtk_widget_show_all(container_);
412 412
413 ui::ActiveWindowWatcherX::AddObserver(this); 413 ui::ActiveWindowWatcherX::AddObserver(this);
414 } 414 }
415 415
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 command_id); 938 command_id);
939 if (accelerator_gtk) 939 if (accelerator_gtk)
940 *accelerator = *accelerator_gtk; 940 *accelerator = *accelerator_gtk;
941 return accelerator_gtk; 941 return accelerator_gtk;
942 } 942 }
943 943
944 void BrowserTitlebar::Observe(NotificationType type, 944 void BrowserTitlebar::Observe(NotificationType type,
945 const NotificationSource& source, 945 const NotificationSource& source,
946 const NotificationDetails& details) { 946 const NotificationDetails& details) {
947 switch (type.value) { 947 switch (type.value) {
948 case NotificationType::BROWSER_THEME_CHANGED: 948 case chrome::BROWSER_THEME_CHANGED:
949 UpdateTextColor(); 949 UpdateTextColor();
950 break; 950 break;
951 951
952 case NotificationType::PREF_CHANGED: { 952 case chrome::PREF_CHANGED: {
953 std::string* name = Details<std::string>(details).ptr(); 953 std::string* name = Details<std::string>(details).ptr();
954 if (prefs::kGoogleServicesUsername == *name) 954 if (prefs::kGoogleServicesUsername == *name)
955 profile_button_->UpdateText(browser_window_->browser()->profile()); 955 profile_button_->UpdateText(browser_window_->browser()->profile());
956 break; 956 break;
957 } 957 }
958 958
959 default: 959 default:
960 NOTREACHED(); 960 NOTREACHED();
961 } 961 }
962 } 962 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 ui::SimpleMenuModel::Delegate* delegate) 1042 ui::SimpleMenuModel::Delegate* delegate)
1043 : SimpleMenuModel(delegate) { 1043 : SimpleMenuModel(delegate) {
1044 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); 1044 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB);
1045 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); 1045 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB);
1046 AddSeparator(); 1046 AddSeparator();
1047 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); 1047 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
1048 AddSeparator(); 1048 AddSeparator();
1049 AddCheckItemWithStringId(kShowWindowDecorationsCommand, 1049 AddCheckItemWithStringId(kShowWindowDecorationsCommand,
1050 IDS_SHOW_WINDOW_DECORATIONS_MENU); 1050 IDS_SHOW_WINDOW_DECORATIONS_MENU);
1051 } 1051 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698