OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 string16 title = browser_window_->browser()->GetWindowTitleForCurrentTab(); | 607 string16 title = browser_window_->browser()->GetWindowTitleForCurrentTab(); |
608 gtk_label_set_text(GTK_LABEL(app_mode_title_), UTF16ToUTF8(title).c_str()); | 608 gtk_label_set_text(GTK_LABEL(app_mode_title_), UTF16ToUTF8(title).c_str()); |
609 | 609 |
610 if (browser_window_->browser()->is_app()) { | 610 if (browser_window_->browser()->is_app()) { |
611 switch (browser_window_->browser()->type()) { | 611 switch (browser_window_->browser()->type()) { |
612 case Browser::TYPE_POPUP: { | 612 case Browser::TYPE_POPUP: { |
613 // Update the system app icon. We don't need to update the icon in the | 613 // Update the system app icon. We don't need to update the icon in the |
614 // top left of the custom frame, that will get updated when the | 614 // top left of the custom frame, that will get updated when the |
615 // throbber is updated. | 615 // throbber is updated. |
616 Profile* profile = browser_window_->browser()->profile(); | 616 Profile* profile = browser_window_->browser()->profile(); |
617 gfx::Image icon = browser_window_->browser()->GetCurrentPageIcon(); | 617 const gfx::Image* icon = browser_window_->browser()->GetCurrentPageIcon( |
618 if (icon.IsEmpty()) { | 618 IconUtil::kMediumIconSize); |
| 619 if (!icon || icon->IsEmpty()) { |
619 gtk_util::SetWindowIcon(window_, profile); | 620 gtk_util::SetWindowIcon(window_, profile); |
620 } else { | 621 } else { |
621 gtk_util::SetWindowIcon(window_, profile, icon.ToGdkPixbuf()); | 622 gtk_util::SetWindowIcon(window_, profile, icon->ToGdkPixbuf()); |
622 } | 623 } |
623 break; | 624 break; |
624 } | 625 } |
625 case Browser::TYPE_TABBED: { | 626 case Browser::TYPE_TABBED: { |
626 NOTREACHED() << "We should never have a tabbed app window."; | 627 NOTREACHED() << "We should never have a tabbed app window."; |
627 break; | 628 break; |
628 } | 629 } |
629 } | 630 } |
630 } | 631 } |
631 } | 632 } |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 ui::SimpleMenuModel::Delegate* delegate) | 1097 ui::SimpleMenuModel::Delegate* delegate) |
1097 : SimpleMenuModel(delegate) { | 1098 : SimpleMenuModel(delegate) { |
1098 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1099 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
1099 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1100 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
1100 AddSeparator(ui::NORMAL_SEPARATOR); | 1101 AddSeparator(ui::NORMAL_SEPARATOR); |
1101 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1102 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
1102 AddSeparator(ui::NORMAL_SEPARATOR); | 1103 AddSeparator(ui::NORMAL_SEPARATOR); |
1103 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1104 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
1104 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1105 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
1105 } | 1106 } |
OLD | NEW |