OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util_mac.h" | 9 #include "app/l10n_util_mac.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/sync/sync_ui_util.h" | 12 #include "chrome/browser/sync/sync_ui_util.h" |
13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
14 | 14 |
15 namespace sync_ui_util { | 15 namespace sync_ui_util { |
16 | 16 |
17 void UpdateSyncItem(id syncItem, BOOL syncEnabled, Profile* profile) { | 17 void UpdateSyncItem(id syncItem, BOOL syncEnabled, Profile* profile) { |
18 ProfileSyncService* syncService = | 18 ProfileSyncService* syncService = |
19 profile->GetOriginalProfile()->GetProfileSyncService(); | 19 profile->GetOriginalProfile()->GetProfileSyncService(); |
20 UpdateSyncItemForStatus(syncItem, syncEnabled, | 20 UpdateSyncItemForStatus(syncItem, syncEnabled, |
21 sync_ui_util::GetStatus(syncService)); | 21 sync_ui_util::GetStatus(syncService)); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 [syncMenuItem setTitle:title]; | 62 [syncMenuItem setTitle:title]; |
63 | 63 |
64 // If we don't have a sync service, hide any sync-related menu | 64 // If we don't have a sync service, hide any sync-related menu |
65 // items. However, sync_menu_item is enabled/disabled outside of this | 65 // items. However, sync_menu_item is enabled/disabled outside of this |
66 // function so we don't touch it here, and separators are always disabled. | 66 // function so we don't touch it here, and separators are always disabled. |
67 [syncMenuItem setHidden:!syncEnabled]; | 67 [syncMenuItem setHidden:!syncEnabled]; |
68 [followingSeparator setHidden:!syncEnabled]; | 68 [followingSeparator setHidden:!syncEnabled]; |
69 } | 69 } |
70 | 70 |
71 } // namespace sync_ui_util | 71 } // namespace sync_ui_util |
OLD | NEW |