| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 void WrenchMenuModel::ActiveTabChanged(WebContents* old_contents, | 425 void WrenchMenuModel::ActiveTabChanged(WebContents* old_contents, |
| 426 WebContents* new_contents, | 426 WebContents* new_contents, |
| 427 int index, | 427 int index, |
| 428 bool user_gesture) { | 428 bool user_gesture) { |
| 429 // The user has switched between tabs and the new tab may have a different | 429 // The user has switched between tabs and the new tab may have a different |
| 430 // zoom setting. | 430 // zoom setting. |
| 431 UpdateZoomControls(); | 431 UpdateZoomControls(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, | 434 void WrenchMenuModel::TabReplacedAt(TabStripModel* tab_strip_model, |
| 435 TabContents* old_contents, | 435 WebContents* old_contents, |
| 436 TabContents* new_contents, | 436 WebContents* new_contents, |
| 437 int index) { | 437 int index) { |
| 438 UpdateZoomControls(); | 438 UpdateZoomControls(); |
| 439 } | 439 } |
| 440 | 440 |
| 441 void WrenchMenuModel::TabStripModelDeleted() { | 441 void WrenchMenuModel::TabStripModelDeleted() { |
| 442 // During views shutdown, the tabstrip model/browser is deleted first, while | 442 // During views shutdown, the tabstrip model/browser is deleted first, while |
| 443 // it is the opposite in gtk land. | 443 // it is the opposite in gtk land. |
| 444 tab_strip_model_->RemoveObserver(this); | 444 tab_strip_model_->RemoveObserver(this); |
| 445 tab_strip_model_ = NULL; | 445 tab_strip_model_ = NULL; |
| 446 } | 446 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 zoom_label_ = l10n_util::GetStringFUTF16( | 722 zoom_label_ = l10n_util::GetStringFUTF16( |
| 723 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 723 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 724 } | 724 } |
| 725 | 725 |
| 726 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 726 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
| 727 Profile* profile = browser_->profile()->GetOriginalProfile(); | 727 Profile* profile = browser_->profile()->GetOriginalProfile(); |
| 728 return sync_ui_util::GetSyncMenuLabel( | 728 return sync_ui_util::GetSyncMenuLabel( |
| 729 ProfileSyncServiceFactory::GetForProfile(profile), | 729 ProfileSyncServiceFactory::GetForProfile(profile), |
| 730 *SigninManagerFactory::GetForProfile(profile)); | 730 *SigninManagerFactory::GetForProfile(profile)); |
| 731 } | 731 } |
| OLD | NEW |