OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "chrome/browser/sync/profile_sync_factory.h" | 34 #include "chrome/browser/sync/profile_sync_factory.h" |
35 #include "chrome/browser/sync/signin_manager.h" | 35 #include "chrome/browser/sync/signin_manager.h" |
36 #include "chrome/browser/sync/token_migrator.h" | 36 #include "chrome/browser/sync/token_migrator.h" |
37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/net/gaia/gaia_constants.h" | 38 #include "chrome/common/net/gaia/gaia_constants.h" |
39 #include "chrome/common/notification_details.h" | 39 #include "chrome/common/notification_details.h" |
40 #include "chrome/common/notification_source.h" | 40 #include "chrome/common/notification_source.h" |
41 #include "chrome/common/notification_type.h" | 41 #include "chrome/common/notification_type.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/time_format.h" | 43 #include "chrome/common/time_format.h" |
| 44 #include "chrome/common/url_constants.h" |
44 #include "grit/chromium_strings.h" | 45 #include "grit/chromium_strings.h" |
45 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
46 #include "jingle/notifier/communicator/const_communicator.h" | 47 #include "jingle/notifier/communicator/const_communicator.h" |
47 #include "net/base/cookie_monster.h" | 48 #include "net/base/cookie_monster.h" |
48 #include "ui/base/l10n/l10n_util.h" | 49 #include "ui/base/l10n/l10n_util.h" |
49 | 50 |
50 using browser_sync::ChangeProcessor; | 51 using browser_sync::ChangeProcessor; |
51 using browser_sync::DataTypeController; | 52 using browser_sync::DataTypeController; |
52 using browser_sync::DataTypeManager; | 53 using browser_sync::DataTypeManager; |
53 using browser_sync::SyncBackendHost; | 54 using browser_sync::SyncBackendHost; |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 | 745 |
745 NotifyObservers(); | 746 NotifyObservers(); |
746 observed_passphrase_required_ = false; | 747 observed_passphrase_required_ = false; |
747 tried_setting_explicit_passphrase_ = false; | 748 tried_setting_explicit_passphrase_ = false; |
748 tried_creating_explicit_passphrase_ = false; | 749 tried_creating_explicit_passphrase_ = false; |
749 | 750 |
750 wizard_.Step(SyncSetupWizard::DONE); | 751 wizard_.Step(SyncSetupWizard::DONE); |
751 } | 752 } |
752 | 753 |
753 void ProfileSyncService::ShowLoginDialog(gfx::NativeWindow parent_window) { | 754 void ProfileSyncService::ShowLoginDialog(gfx::NativeWindow parent_window) { |
754 // TODO(johnnyg): File a bug to make sure this doesn't happen. | |
755 if (!cros_user_.empty()) { | 755 if (!cros_user_.empty()) { |
756 LOG(WARNING) << "ShowLoginDialog called on Chrome OS."; | 756 // For ChromeOS, any login UI needs to be handled by the settings page. |
| 757 Browser* browser = BrowserList::GetLastActiveWithProfile(profile()); |
| 758 if (browser) |
| 759 browser->ShowOptionsTab(chrome::kPersonalOptionsSubPage); |
757 return; | 760 return; |
758 } | 761 } |
759 | 762 |
760 if (WizardIsVisible()) { | 763 if (WizardIsVisible()) { |
761 wizard_.Focus(); | 764 wizard_.Focus(); |
762 return; | 765 return; |
763 } | 766 } |
764 | 767 |
765 if (!auth_error_time_.is_null()) { | 768 if (!auth_error_time_.is_null()) { |
766 UMA_HISTOGRAM_LONG_TIMES("Sync.ReauthorizationTime", | 769 UMA_HISTOGRAM_LONG_TIMES("Sync.ReauthorizationTime", |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 // is initialized, all enabled data types are consistent with one | 1318 // is initialized, all enabled data types are consistent with one |
1316 // another, and no unrecoverable error has transpired. | 1319 // another, and no unrecoverable error has transpired. |
1317 if (unrecoverable_error_detected_) | 1320 if (unrecoverable_error_detected_) |
1318 return false; | 1321 return false; |
1319 | 1322 |
1320 if (!data_type_manager_.get()) | 1323 if (!data_type_manager_.get()) |
1321 return false; | 1324 return false; |
1322 | 1325 |
1323 return data_type_manager_->state() == DataTypeManager::CONFIGURED; | 1326 return data_type_manager_->state() == DataTypeManager::CONFIGURED; |
1324 } | 1327 } |
OLD | NEW |