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

Side by Side Diff: chrome/browser/ui/gtk/browser_titlebar.cc

Issue 64853004: Use high resolution icons where possible for streamlined hosted app icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_experiment_create_app_from_page
Patch Set: rework, add tests Created 7 years, 1 month 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
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698