OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/preferences_window_controller.h" | 5 #import "chrome/browser/cocoa/preferences_window_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1706 // TODO(akalin): Change the background of the status label/link on error. | 1706 // TODO(akalin): Change the background of the status label/link on error. |
1707 - (void)syncStateChanged { | 1707 - (void)syncStateChanged { |
1708 DCHECK(syncService_); | 1708 DCHECK(syncService_); |
1709 | 1709 |
1710 string16 statusLabel, linkLabel; | 1710 string16 statusLabel, linkLabel; |
1711 sync_ui_util::MessageType status = | 1711 sync_ui_util::MessageType status = |
1712 sync_ui_util::GetStatusLabels(syncService_, &statusLabel, &linkLabel); | 1712 sync_ui_util::GetStatusLabels(syncService_, &statusLabel, &linkLabel); |
1713 | 1713 |
1714 [syncButton_ setEnabled:!syncService_->WizardIsVisible()]; | 1714 [syncButton_ setEnabled:!syncService_->WizardIsVisible()]; |
1715 NSString* buttonLabel; | 1715 NSString* buttonLabel; |
1716 if (syncService_->HasSyncSetupCompleted() | 1716 if (syncService_->HasSyncSetupCompleted()) { |
1717 && status != sync_ui_util::SYNC_ERROR) { | |
1718 buttonLabel = l10n_util::GetNSStringWithFixup( | 1717 buttonLabel = l10n_util::GetNSStringWithFixup( |
1719 IDS_SYNC_STOP_SYNCING_BUTTON_LABEL); | 1718 IDS_SYNC_STOP_SYNCING_BUTTON_LABEL); |
1720 [syncCustomizeButton_ setHidden:false]; | 1719 [syncCustomizeButton_ setHidden:false]; |
1721 } else if (syncService_->SetupInProgress()) { | 1720 } else if (syncService_->SetupInProgress()) { |
1722 buttonLabel = l10n_util::GetNSStringWithFixup( | 1721 buttonLabel = l10n_util::GetNSStringWithFixup( |
1723 IDS_SYNC_NTP_SETUP_IN_PROGRESS); | 1722 IDS_SYNC_NTP_SETUP_IN_PROGRESS); |
1724 [syncCustomizeButton_ setHidden:true]; | 1723 [syncCustomizeButton_ setHidden:true]; |
1725 } else { | 1724 } else { |
1726 buttonLabel = l10n_util::GetNSStringWithFixup( | 1725 buttonLabel = l10n_util::GetNSStringWithFixup( |
1727 IDS_SYNC_START_SYNC_BUTTON_LABEL); | 1726 IDS_SYNC_START_SYNC_BUTTON_LABEL); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 case OPTIONS_PAGE_ADVANCED: | 2018 case OPTIONS_PAGE_ADVANCED: |
2020 return underTheHoodView_; | 2019 return underTheHoodView_; |
2021 case OPTIONS_PAGE_DEFAULT: | 2020 case OPTIONS_PAGE_DEFAULT: |
2022 case OPTIONS_PAGE_COUNT: | 2021 case OPTIONS_PAGE_COUNT: |
2023 LOG(DFATAL) << "Invalid page value " << page; | 2022 LOG(DFATAL) << "Invalid page value " << page; |
2024 } | 2023 } |
2025 return basicsView_; | 2024 return basicsView_; |
2026 } | 2025 } |
2027 | 2026 |
2028 @end | 2027 @end |
OLD | NEW |