Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 10891033: Switch MetroPinTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small clean Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698