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

Side by Side Diff: chrome/browser/ui/toolbar/app_menu_model.cc

Issue 1676623002: Update upgrade app menu icons for MD/vectorization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reduce verbosity Created 4 years, 10 months 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
« no previous file with comments | « no previous file | chrome/browser/upgrade_detector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/toolbar/app_menu_model.h" 5 #include "chrome/browser/ui/toolbar/app_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 #endif 354 #endif
355 case IDC_UPGRADE_DIALOG: 355 case IDC_UPGRADE_DIALOG:
356 return GetUpgradeDialogMenuItemName(); 356 return GetUpgradeDialogMenuItemName();
357 default: 357 default:
358 NOTREACHED(); 358 NOTREACHED();
359 return base::string16(); 359 return base::string16();
360 } 360 }
361 } 361 }
362 362
363 bool AppMenuModel::GetIconForCommandId(int command_id, gfx::Image* icon) const { 363 bool AppMenuModel::GetIconForCommandId(int command_id, gfx::Image* icon) const {
364 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 364 if (command_id == IDC_UPGRADE_DIALOG &&
365 switch (command_id) { 365 UpgradeDetector::GetInstance()->notify_upgrade()) {
366 case IDC_UPGRADE_DIALOG: { 366 *icon = UpgradeDetector::GetInstance()->GetIcon();
367 if (UpgradeDetector::GetInstance()->notify_upgrade()) { 367 return true;
368 *icon = rb.GetNativeImageNamed(
369 UpgradeDetector::GetInstance()->GetIconResourceID());
370 return true;
371 }
372 return false;
373 }
374 default:
375 break;
376 } 368 }
377 return false; 369 return false;
378 } 370 }
379 371
380 void AppMenuModel::ExecuteCommand(int command_id, int event_flags) { 372 void AppMenuModel::ExecuteCommand(int command_id, int event_flags) {
381 GlobalError* error = GlobalErrorServiceFactory::GetForProfile( 373 GlobalError* error = GlobalErrorServiceFactory::GetForProfile(
382 browser_->profile())->GetGlobalErrorByMenuItemCommandID(command_id); 374 browser_->profile())->GetGlobalErrorByMenuItemCommandID(command_id);
383 if (error) { 375 if (error) {
384 error->ExecuteMenuItem(browser_); 376 error->ExecuteMenuItem(browser_);
385 return; 377 return;
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 ->GetZoomPercent(); 935 ->GetZoomPercent();
944 } 936 }
945 zoom_label_ = l10n_util::GetStringFUTF16( 937 zoom_label_ = l10n_util::GetStringFUTF16(
946 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 938 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
947 } 939 }
948 940
949 void AppMenuModel::OnZoomLevelChanged( 941 void AppMenuModel::OnZoomLevelChanged(
950 const content::HostZoomMap::ZoomLevelChange& change) { 942 const content::HostZoomMap::ZoomLevelChange& change) {
951 UpdateZoomControls(); 943 UpdateZoomControls();
952 } 944 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/upgrade_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698