| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 if (!username.empty()) { | 280 if (!username.empty()) { |
| 281 return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_SYNCED_LABEL, | 281 return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_SYNCED_LABEL, |
| 282 UTF8ToUTF16(username)); | 282 UTF8ToUTF16(username)); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_PRE_SYNCED_LABEL, | 285 return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_PRE_SYNCED_LABEL, |
| 286 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); | 286 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); |
| 287 } | 287 } |
| 288 case IDC_PIN_TO_START_SCREEN: { | 288 case IDC_PIN_TO_START_SCREEN: { |
| 289 int string_id = IDS_PIN_TO_START_SCREEN; | 289 int string_id = IDS_PIN_TO_START_SCREEN; |
| 290 TabContents* tab_contents = chrome::GetActiveTabContents(browser_); | 290 WebContents* web_contents = chrome::GetActiveWebContents(browser_); |
| 291 if (tab_contents && tab_contents->metro_pin_tab_helper()->is_pinned()) { | 291 MetroPinTabHelper* tab_helper = |
| 292 web_contents ? MetroPinTabHelper::FromWebContents(web_contents) |
| 293 : NULL; |
| 294 if (tab_helper && tab_helper->is_pinned()) |
| 292 string_id = IDS_UNPIN_FROM_START_SCREEN; | 295 string_id = IDS_UNPIN_FROM_START_SCREEN; |
| 293 } | |
| 294 return l10n_util::GetStringUTF16(string_id); | 296 return l10n_util::GetStringUTF16(string_id); |
| 295 } | 297 } |
| 296 default: | 298 default: |
| 297 NOTREACHED(); | 299 NOTREACHED(); |
| 298 return string16(); | 300 return string16(); |
| 299 } | 301 } |
| 300 } | 302 } |
| 301 | 303 |
| 302 bool WrenchMenuModel::GetIconForCommandId(int command_id, | 304 bool WrenchMenuModel::GetIconForCommandId(int command_id, |
| 303 gfx::Image* icon) const { | 305 gfx::Image* icon) const { |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 zoom_label_ = l10n_util::GetStringFUTF16( | 693 zoom_label_ = l10n_util::GetStringFUTF16( |
| 692 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 694 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 693 } | 695 } |
| 694 | 696 |
| 695 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 697 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
| 696 Profile* profile = browser_->profile()->GetOriginalProfile(); | 698 Profile* profile = browser_->profile()->GetOriginalProfile(); |
| 697 return sync_ui_util::GetSyncMenuLabel( | 699 return sync_ui_util::GetSyncMenuLabel( |
| 698 ProfileSyncServiceFactory::GetForProfile(profile), | 700 ProfileSyncServiceFactory::GetForProfile(profile), |
| 699 *SigninManagerFactory::GetForProfile(profile)); | 701 *SigninManagerFactory::GetForProfile(profile)); |
| 700 } | 702 } |
| OLD | NEW |