| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 412 } |
| 413 return true; | 413 return true; |
| 414 } | 414 } |
| 415 | 415 |
| 416 bool WrenchMenuModel::GetAcceleratorForCommandId( | 416 bool WrenchMenuModel::GetAcceleratorForCommandId( |
| 417 int command_id, | 417 int command_id, |
| 418 ui::Accelerator* accelerator) { | 418 ui::Accelerator* accelerator) { |
| 419 return provider_->GetAcceleratorForCommandId(command_id, accelerator); | 419 return provider_->GetAcceleratorForCommandId(command_id, accelerator); |
| 420 } | 420 } |
| 421 | 421 |
| 422 void WrenchMenuModel::ActiveTabChanged(TabContents* old_contents, | 422 void WrenchMenuModel::ActiveTabChanged(WebContents* old_contents, |
| 423 TabContents* new_contents, | 423 WebContents* new_contents, |
| 424 int index, | 424 int index, |
| 425 bool user_gesture) { | 425 bool user_gesture) { |
| 426 // The user has switched between tabs and the new tab may have a different | 426 // The user has switched between tabs and the new tab may have a different |
| 427 // zoom setting. | 427 // zoom setting. |
| 428 UpdateZoomControls(); | 428 UpdateZoomControls(); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, | 431 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, |
| 432 TabContents* old_contents, | 432 TabContents* old_contents, |
| 433 TabContents* new_contents, | 433 TabContents* new_contents, |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 zoom_label_ = l10n_util::GetStringFUTF16( | 711 zoom_label_ = l10n_util::GetStringFUTF16( |
| 712 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 712 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 713 } | 713 } |
| 714 | 714 |
| 715 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 715 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
| 716 Profile* profile = browser_->profile()->GetOriginalProfile(); | 716 Profile* profile = browser_->profile()->GetOriginalProfile(); |
| 717 return sync_ui_util::GetSyncMenuLabel( | 717 return sync_ui_util::GetSyncMenuLabel( |
| 718 ProfileSyncServiceFactory::GetForProfile(profile), | 718 ProfileSyncServiceFactory::GetForProfile(profile), |
| 719 *SigninManagerFactory::GetForProfile(profile)); | 719 *SigninManagerFactory::GetForProfile(profile)); |
| 720 } | 720 } |
| OLD | NEW |