| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 } | 355 } |
| 356 return true; | 356 return true; |
| 357 } | 357 } |
| 358 | 358 |
| 359 bool WrenchMenuModel::GetAcceleratorForCommandId( | 359 bool WrenchMenuModel::GetAcceleratorForCommandId( |
| 360 int command_id, | 360 int command_id, |
| 361 ui::Accelerator* accelerator) { | 361 ui::Accelerator* accelerator) { |
| 362 return provider_->GetAcceleratorForCommandId(command_id, accelerator); | 362 return provider_->GetAcceleratorForCommandId(command_id, accelerator); |
| 363 } | 363 } |
| 364 | 364 |
| 365 void WrenchMenuModel::TabSelectedAt(TabContentsWrapper* old_contents, | 365 void WrenchMenuModel::ActiveTabChanged(TabContentsWrapper* old_contents, |
| 366 TabContentsWrapper* new_contents, | 366 TabContentsWrapper* new_contents, |
| 367 int index, | 367 int index, |
| 368 bool user_gesture) { | 368 bool user_gesture) { |
| 369 // The user has switched between tabs and the new tab may have a different | 369 // The user has switched between tabs and the new tab may have a different |
| 370 // zoom setting. | 370 // zoom setting. |
| 371 UpdateZoomControls(); | 371 UpdateZoomControls(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, | 374 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, |
| 375 TabContentsWrapper* old_contents, | 375 TabContentsWrapper* old_contents, |
| 376 TabContentsWrapper* new_contents, | 376 TabContentsWrapper* new_contents, |
| 377 int index) { | 377 int index) { |
| 378 UpdateZoomControls(); | 378 UpdateZoomControls(); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 &enable_increment, &enable_decrement); | 558 &enable_increment, &enable_decrement); |
| 559 } | 559 } |
| 560 zoom_label_ = l10n_util::GetStringFUTF16( | 560 zoom_label_ = l10n_util::GetStringFUTF16( |
| 561 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 561 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 562 } | 562 } |
| 563 | 563 |
| 564 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 564 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
| 565 return sync_ui_util::GetSyncMenuLabel( | 565 return sync_ui_util::GetSyncMenuLabel( |
| 566 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); | 566 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); |
| 567 } | 567 } |
| OLD | NEW |