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/wrench_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/wrench_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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 bool WrenchMenuModel::GetIconForCommandId(int command_id, | 361 bool WrenchMenuModel::GetIconForCommandId(int command_id, |
362 gfx::Image* icon) const { | 362 gfx::Image* icon) const { |
363 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 363 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
364 switch (command_id) { | 364 switch (command_id) { |
365 case IDC_UPGRADE_DIALOG: { | 365 case IDC_UPGRADE_DIALOG: { |
366 if (UpgradeDetector::GetInstance()->notify_upgrade()) { | 366 if (UpgradeDetector::GetInstance()->notify_upgrade()) { |
367 *icon = rb.GetNativeImageNamed( | 367 *icon = rb.GetNativeImageNamed( |
368 UpgradeDetector::GetInstance()->GetIconResourceID( | 368 UpgradeDetector::GetInstance()->GetIconResourceID()); |
369 UpgradeDetector::UPGRADE_ICON_TYPE_MENU_ICON)); | |
370 return true; | 369 return true; |
371 } | 370 } |
372 return false; | 371 return false; |
373 } | 372 } |
374 case IDC_SHOW_SIGNIN: { | 373 case IDC_SHOW_SIGNIN: { |
375 DCHECK(!switches::IsNewProfileManagement()); | 374 DCHECK(!switches::IsNewProfileManagement()); |
376 GlobalError* error = signin_ui_util::GetSignedInServiceError( | 375 GlobalError* error = signin_ui_util::GetSignedInServiceError( |
377 browser_->profile()->GetOriginalProfile()); | 376 browser_->profile()->GetOriginalProfile()); |
378 if (error) { | 377 if (error) { |
379 int icon_id = error->MenuItemIconResourceID(); | 378 int icon_id = error->MenuItemIconResourceID(); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 ->GetZoomPercent(); | 808 ->GetZoomPercent(); |
810 } | 809 } |
811 zoom_label_ = l10n_util::GetStringFUTF16( | 810 zoom_label_ = l10n_util::GetStringFUTF16( |
812 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 811 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
813 } | 812 } |
814 | 813 |
815 void WrenchMenuModel::OnZoomLevelChanged( | 814 void WrenchMenuModel::OnZoomLevelChanged( |
816 const content::HostZoomMap::ZoomLevelChange& change) { | 815 const content::HostZoomMap::ZoomLevelChange& change) { |
817 UpdateZoomControls(); | 816 UpdateZoomControls(); |
818 } | 817 } |
OLD | NEW |