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