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/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 Loading... | |
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(); | |
365 switch (command_id) { | 364 switch (command_id) { |
sky
2016/02/08 17:13:17
nit: this is a lot of code just to say:
if (comman
Evan Stade
2016/02/08 19:31:12
ha, indeed
| |
366 case IDC_UPGRADE_DIALOG: { | 365 case IDC_UPGRADE_DIALOG: { |
367 if (UpgradeDetector::GetInstance()->notify_upgrade()) { | 366 if (UpgradeDetector::GetInstance()->notify_upgrade()) { |
368 *icon = rb.GetNativeImageNamed( | 367 *icon = UpgradeDetector::GetInstance()->GetIcon(); |
369 UpgradeDetector::GetInstance()->GetIconResourceID()); | |
370 return true; | 368 return true; |
371 } | 369 } |
372 return false; | 370 return false; |
373 } | 371 } |
374 default: | 372 default: |
375 break; | 373 break; |
376 } | 374 } |
377 return false; | 375 return false; |
378 } | 376 } |
379 | 377 |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 ->GetZoomPercent(); | 941 ->GetZoomPercent(); |
944 } | 942 } |
945 zoom_label_ = l10n_util::GetStringFUTF16( | 943 zoom_label_ = l10n_util::GetStringFUTF16( |
946 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 944 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
947 } | 945 } |
948 | 946 |
949 void AppMenuModel::OnZoomLevelChanged( | 947 void AppMenuModel::OnZoomLevelChanged( |
950 const content::HostZoomMap::ZoomLevelChange& change) { | 948 const content::HostZoomMap::ZoomLevelChange& change) { |
951 UpdateZoomControls(); | 949 UpdateZoomControls(); |
952 } | 950 } |
OLD | NEW |