| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 } | 377 } |
| 378 return true; | 378 return true; |
| 379 } | 379 } |
| 380 | 380 |
| 381 bool WrenchMenuModel::GetAcceleratorForCommandId( | 381 bool WrenchMenuModel::GetAcceleratorForCommandId( |
| 382 int command_id, | 382 int command_id, |
| 383 ui::Accelerator* accelerator) { | 383 ui::Accelerator* accelerator) { |
| 384 return provider_->GetAcceleratorForCommandId(command_id, accelerator); | 384 return provider_->GetAcceleratorForCommandId(command_id, accelerator); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void WrenchMenuModel::ActiveTabChanged(TabContentsWrapper* old_contents, | 387 void WrenchMenuModel::ActiveTabChanged(TabContents* old_contents, |
| 388 TabContentsWrapper* new_contents, | 388 TabContents* new_contents, |
| 389 int index, | 389 int index, |
| 390 bool user_gesture) { | 390 bool user_gesture) { |
| 391 // The user has switched between tabs and the new tab may have a different | 391 // The user has switched between tabs and the new tab may have a different |
| 392 // zoom setting. | 392 // zoom setting. |
| 393 UpdateZoomControls(); | 393 UpdateZoomControls(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, | 396 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, |
| 397 TabContentsWrapper* old_contents, | 397 TabContents* old_contents, |
| 398 TabContentsWrapper* new_contents, | 398 TabContents* new_contents, |
| 399 int index) { | 399 int index) { |
| 400 UpdateZoomControls(); | 400 UpdateZoomControls(); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void WrenchMenuModel::TabStripModelDeleted() { | 403 void WrenchMenuModel::TabStripModelDeleted() { |
| 404 // During views shutdown, the tabstrip model/browser is deleted first, while | 404 // During views shutdown, the tabstrip model/browser is deleted first, while |
| 405 // it is the opposite in gtk land. | 405 // it is the opposite in gtk land. |
| 406 tab_strip_model_->RemoveObserver(this); | 406 tab_strip_model_->RemoveObserver(this); |
| 407 tab_strip_model_ = NULL; | 407 tab_strip_model_ = NULL; |
| 408 } | 408 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 zoom_label_ = l10n_util::GetStringFUTF16( | 613 zoom_label_ = l10n_util::GetStringFUTF16( |
| 614 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 614 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 615 } | 615 } |
| 616 | 616 |
| 617 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 617 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
| 618 Profile* profile = browser_->profile()->GetOriginalProfile(); | 618 Profile* profile = browser_->profile()->GetOriginalProfile(); |
| 619 return sync_ui_util::GetSyncMenuLabel( | 619 return sync_ui_util::GetSyncMenuLabel( |
| 620 ProfileSyncServiceFactory::GetForProfile(profile), | 620 ProfileSyncServiceFactory::GetForProfile(profile), |
| 621 *SigninManagerFactory::GetForProfile(profile)); | 621 *SigninManagerFactory::GetForProfile(profile)); |
| 622 } | 622 } |
| OLD | NEW |