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/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 28 matching lines...) Expand all Loading... |
39 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 39 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
40 #include "chrome/common/chrome_notification_types.h" | 40 #include "chrome/common/chrome_notification_types.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "content/browser/tab_contents/tab_contents.h" | 43 #include "content/browser/tab_contents/tab_contents.h" |
44 #include "content/common/notification_service.h" | 44 #include "content/common/notification_service.h" |
45 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
46 #include "grit/theme_resources.h" | 46 #include "grit/theme_resources.h" |
47 #include "grit/theme_resources_standard.h" | 47 #include "grit/theme_resources_standard.h" |
48 #include "grit/ui_resources.h" | 48 #include "grit/ui_resources.h" |
| 49 #include "ui/base/gtk/gtk_hig_constants.h" |
49 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
50 #include "ui/base/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
51 #include "ui/gfx/gtk_util.h" | 52 #include "ui/gfx/gtk_util.h" |
52 #include "ui/gfx/image/image.h" | 53 #include "ui/gfx/image/image.h" |
53 #include "ui/gfx/skbitmap_operations.h" | 54 #include "ui/gfx/skbitmap_operations.h" |
54 | 55 |
55 namespace { | 56 namespace { |
56 | 57 |
57 // The space above the titlebars. | 58 // The space above the titlebars. |
58 const int kTitlebarHeight = 14; | 59 const int kTitlebarHeight = 14; |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 // color. | 752 // color. |
752 GdkColor frame_color; | 753 GdkColor frame_color; |
753 if (window_has_focus_) { | 754 if (window_has_focus_) { |
754 frame_color = theme_service_->GetGdkColor( | 755 frame_color = theme_service_->GetGdkColor( |
755 ThemeService::COLOR_FRAME); | 756 ThemeService::COLOR_FRAME); |
756 } else { | 757 } else { |
757 frame_color = theme_service_->GetGdkColor( | 758 frame_color = theme_service_->GetGdkColor( |
758 ThemeService::COLOR_FRAME_INACTIVE); | 759 ThemeService::COLOR_FRAME_INACTIVE); |
759 } | 760 } |
760 GdkColor text_color = PickLuminosityContrastingColor( | 761 GdkColor text_color = PickLuminosityContrastingColor( |
761 &frame_color, >k_util::kGdkWhite, >k_util::kGdkBlack); | 762 &frame_color, &ui::kGdkWhite, &ui::kGdkBlack); |
762 gtk_util::SetLabelColor(app_mode_title_, &text_color); | 763 gtk_util::SetLabelColor(app_mode_title_, &text_color); |
763 } else { | 764 } else { |
764 gtk_util::SetLabelColor(app_mode_title_, >k_util::kGdkWhite); | 765 gtk_util::SetLabelColor(app_mode_title_, &ui::kGdkWhite); |
765 } | 766 } |
766 } | 767 } |
767 | 768 |
768 void BrowserTitlebar::ShowFaviconMenu(GdkEventButton* event) { | 769 void BrowserTitlebar::ShowFaviconMenu(GdkEventButton* event) { |
769 if (!favicon_menu_model_.get()) { | 770 if (!favicon_menu_model_.get()) { |
770 favicon_menu_model_.reset( | 771 favicon_menu_model_.reset( |
771 new PopupPageMenuModel(this, browser_window_->browser())); | 772 new PopupPageMenuModel(this, browser_window_->browser())); |
772 | 773 |
773 favicon_menu_.reset(new MenuGtk(NULL, favicon_menu_model_.get())); | 774 favicon_menu_.reset(new MenuGtk(NULL, favicon_menu_model_.get())); |
774 } | 775 } |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 ui::SimpleMenuModel::Delegate* delegate) | 1048 ui::SimpleMenuModel::Delegate* delegate) |
1048 : SimpleMenuModel(delegate) { | 1049 : SimpleMenuModel(delegate) { |
1049 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1050 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
1050 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1051 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
1051 AddSeparator(); | 1052 AddSeparator(); |
1052 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1053 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
1053 AddSeparator(); | 1054 AddSeparator(); |
1054 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1055 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
1055 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1056 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
1056 } | 1057 } |
OLD | NEW |