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

Side by Side Diff: chrome/browser/sync/sync_ui_util_mac.mm

Issue 9959038: Removed ProfileSyncService::UIShouldDepictAuthInProgress (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT. Created 8 years, 8 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/sync/sync_ui_util.cc ('k') | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | 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/sync/sync_ui_util_mac.h" 5 #include "chrome/browser/sync/sync_ui_util_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/signin/signin_manager.h"
14 #include "chrome/browser/signin/signin_manager_factory.h"
13 #include "chrome/browser/sync/profile_sync_service.h" 15 #include "chrome/browser/sync/profile_sync_service.h"
14 #include "chrome/browser/sync/profile_sync_service_factory.h" 16 #include "chrome/browser/sync/profile_sync_service_factory.h"
15 #include "chrome/browser/sync/sync_ui_util.h" 17 #include "chrome/browser/sync/sync_ui_util.h"
16 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
17 #include "grit/chromium_strings.h" 19 #include "grit/chromium_strings.h"
18 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
19 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
20 #include "ui/base/l10n/l10n_util_mac.h" 22 #include "ui/base/l10n/l10n_util_mac.h"
21 23
22 using l10n_util::GetStringUTF16; 24 using l10n_util::GetStringUTF16;
23 using l10n_util::GetNSStringWithFixup; 25 using l10n_util::GetNSStringWithFixup;
24 using l10n_util::GetNSStringFWithFixup; 26 using l10n_util::GetNSStringFWithFixup;
25 27
26 namespace sync_ui_util { 28 namespace sync_ui_util {
27 29
28 void UpdateSyncItem(id syncItem, BOOL syncEnabled, Profile* profile) { 30 void UpdateSyncItem(id syncItem, BOOL syncEnabled, Profile* profile) {
29 ProfileSyncService* syncService = 31 ProfileSyncService* syncService =
30 ProfileSyncServiceFactory::GetInstance()->GetForProfile( 32 ProfileSyncServiceFactory::GetInstance()->GetForProfile(
31 profile->GetOriginalProfile()); 33 profile->GetOriginalProfile());
34 SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
32 UpdateSyncItemForStatus( 35 UpdateSyncItemForStatus(
33 syncItem, 36 syncItem,
34 syncEnabled, 37 syncEnabled,
35 sync_ui_util::GetStatus(syncService), 38 sync_ui_util::GetStatus(syncService, *signin),
36 profile->GetPrefs()->GetString(prefs::kGoogleServicesUsername)); 39 profile->GetPrefs()->GetString(prefs::kGoogleServicesUsername));
37 } 40 }
38 41
39 void UpdateSyncItemForStatus(id syncItem, BOOL syncEnabled, 42 void UpdateSyncItemForStatus(id syncItem, BOOL syncEnabled,
40 sync_ui_util::MessageType status, 43 sync_ui_util::MessageType status,
41 const std::string& userName) { 44 const std::string& userName) {
42 DCHECK([syncItem isKindOfClass:[NSMenuItem class]]); 45 DCHECK([syncItem isKindOfClass:[NSMenuItem class]]);
43 NSMenuItem* syncMenuItem = static_cast<NSMenuItem*>(syncItem); 46 NSMenuItem* syncMenuItem = static_cast<NSMenuItem*>(syncItem);
44 // Look for a separator immediately after the menu item. 47 // Look for a separator immediately after the menu item.
45 NSMenuItem* followingSeparator = nil; 48 NSMenuItem* followingSeparator = nil;
(...skipping 30 matching lines...) Expand all
76 [syncMenuItem setTitle:title]; 79 [syncMenuItem setTitle:title];
77 80
78 // If we don't have a sync service, hide any sync-related menu 81 // If we don't have a sync service, hide any sync-related menu
79 // items. However, sync_menu_item is enabled/disabled outside of this 82 // items. However, sync_menu_item is enabled/disabled outside of this
80 // function so we don't touch it here, and separators are always disabled. 83 // function so we don't touch it here, and separators are always disabled.
81 [syncMenuItem setHidden:!syncEnabled]; 84 [syncMenuItem setHidden:!syncEnabled];
82 [followingSeparator setHidden:!syncEnabled]; 85 [followingSeparator setHidden:!syncEnabled];
83 } 86 }
84 87
85 } // namespace sync_ui_util 88 } // namespace sync_ui_util
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_ui_util.cc ('k') | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698