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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 } | 633 } |
634 } | 634 } |
635 } | 635 } |
636 } | 636 } |
637 | 637 |
638 void BrowserTitlebar::UpdateThrobber(TabContents* tab_contents) { | 638 void BrowserTitlebar::UpdateThrobber(TabContents* tab_contents) { |
639 DCHECK(app_mode_favicon_); | 639 DCHECK(app_mode_favicon_); |
640 | 640 |
641 if (tab_contents && tab_contents->IsLoading()) { | 641 if (tab_contents && tab_contents->IsLoading()) { |
642 GdkPixbuf* icon_pixbuf = | 642 GdkPixbuf* icon_pixbuf = |
643 throbber_.GetNextFrame(tab_contents->waiting_for_response()); | 643 throbber_.GetNextFrame(tab_contents->IsWaitingForResponse()); |
644 gtk_image_set_from_pixbuf(GTK_IMAGE(app_mode_favicon_), icon_pixbuf); | 644 gtk_image_set_from_pixbuf(GTK_IMAGE(app_mode_favicon_), icon_pixbuf); |
645 } else { | 645 } else { |
646 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 646 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
647 | 647 |
648 // Note: we want to exclude the application popup window. | 648 // Note: we want to exclude the application popup window. |
649 if (browser_window_->browser()->is_app() && | 649 if (browser_window_->browser()->is_app() && |
650 browser_window_->browser()->is_type_popup()) { | 650 browser_window_->browser()->is_type_popup()) { |
651 SkBitmap icon = browser_window_->browser()->GetCurrentPageIcon(); | 651 SkBitmap icon = browser_window_->browser()->GetCurrentPageIcon(); |
652 if (icon.empty()) { | 652 if (icon.empty()) { |
653 // Fallback to the Chromium icon if the page has no icon. | 653 // Fallback to the Chromium icon if the page has no icon. |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 PrefService* prefs = browser_window_->browser()->profile()->GetPrefs(); | 984 PrefService* prefs = browser_window_->browser()->profile()->GetPrefs(); |
985 return !prefs->GetBoolean(prefs::kUseCustomChromeFrame); | 985 return !prefs->GetBoolean(prefs::kUseCustomChromeFrame); |
986 } | 986 } |
987 | 987 |
988 EncodingMenuController controller; | 988 EncodingMenuController controller; |
989 if (controller.DoesCommandBelongToEncodingMenu(command_id)) { | 989 if (controller.DoesCommandBelongToEncodingMenu(command_id)) { |
990 TabContents* tab_contents = | 990 TabContents* tab_contents = |
991 browser_window_->browser()->GetSelectedTabContents(); | 991 browser_window_->browser()->GetSelectedTabContents(); |
992 if (tab_contents) { | 992 if (tab_contents) { |
993 return controller.IsItemChecked(browser_window_->browser()->profile(), | 993 return controller.IsItemChecked(browser_window_->browser()->profile(), |
994 tab_contents->encoding(), | 994 tab_contents->GetEncoding(), |
995 command_id); | 995 command_id); |
996 } | 996 } |
997 return false; | 997 return false; |
998 } | 998 } |
999 | 999 |
1000 NOTREACHED(); | 1000 NOTREACHED(); |
1001 return false; | 1001 return false; |
1002 } | 1002 } |
1003 | 1003 |
1004 void BrowserTitlebar::ExecuteCommand(int command_id) { | 1004 void BrowserTitlebar::ExecuteCommand(int command_id) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 ui::SimpleMenuModel::Delegate* delegate) | 1140 ui::SimpleMenuModel::Delegate* delegate) |
1141 : SimpleMenuModel(delegate) { | 1141 : SimpleMenuModel(delegate) { |
1142 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1142 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
1143 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1143 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
1144 AddSeparator(); | 1144 AddSeparator(); |
1145 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1145 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
1146 AddSeparator(); | 1146 AddSeparator(); |
1147 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1147 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
1148 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1148 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
1149 } | 1149 } |
OLD | NEW |