| OLD | NEW |
| 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/webui/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "chrome/browser/sync/profile_sync_service_factory.h" | 32 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 33 #include "chrome/browser/ui/browser_finder.h" | 33 #include "chrome/browser/ui/browser_finder.h" |
| 34 #include "chrome/browser/ui/browser_navigator.h" | 34 #include "chrome/browser/ui/browser_navigator.h" |
| 35 #include "chrome/browser/ui/singleton_tabs.h" | 35 #include "chrome/browser/ui/singleton_tabs.h" |
| 36 #include "chrome/browser/ui/sync/signin_histogram.h" | 36 #include "chrome/browser/ui/sync/signin_histogram.h" |
| 37 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 37 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 38 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 38 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 39 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 42 #include "components/sync_driver/sync_prefs.h" |
| 42 #include "content/public/browser/render_view_host.h" | 43 #include "content/public/browser/render_view_host.h" |
| 43 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
| 44 #include "content/public/browser/web_contents_delegate.h" | 45 #include "content/public/browser/web_contents_delegate.h" |
| 45 #include "google_apis/gaia/gaia_auth_util.h" | 46 #include "google_apis/gaia/gaia_auth_util.h" |
| 46 #include "google_apis/gaia/gaia_constants.h" | 47 #include "google_apis/gaia/gaia_constants.h" |
| 47 #include "grit/chromium_strings.h" | 48 #include "grit/chromium_strings.h" |
| 48 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
| 49 #include "grit/locale_settings.h" | 50 #include "grit/locale_settings.h" |
| 50 #include "net/base/url_util.h" | 51 #include "net/base/url_util.h" |
| 51 #include "ui/base/l10n/l10n_util.h" | 52 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 service->GetPreferredDataTypes(); | 346 service->GetPreferredDataTypes(); |
| 346 ModelTypeNameMap type_names = GetSelectableTypeNameMap(); | 347 ModelTypeNameMap type_names = GetSelectableTypeNameMap(); |
| 347 for (ModelTypeNameMap::const_iterator it = type_names.begin(); | 348 for (ModelTypeNameMap::const_iterator it = type_names.begin(); |
| 348 it != type_names.end(); ++it) { | 349 it != type_names.end(); ++it) { |
| 349 syncer::ModelType sync_type = it->first; | 350 syncer::ModelType sync_type = it->first; |
| 350 const std::string key_name = it->second; | 351 const std::string key_name = it->second; |
| 351 args.SetBoolean(key_name + "Registered", | 352 args.SetBoolean(key_name + "Registered", |
| 352 registered_types.Has(sync_type)); | 353 registered_types.Has(sync_type)); |
| 353 args.SetBoolean(key_name + "Synced", preferred_types.Has(sync_type)); | 354 args.SetBoolean(key_name + "Synced", preferred_types.Has(sync_type)); |
| 354 } | 355 } |
| 355 browser_sync::SyncPrefs sync_prefs(GetProfile()->GetPrefs()); | 356 sync_driver::SyncPrefs sync_prefs(GetProfile()->GetPrefs()); |
| 356 args.SetBoolean("passphraseFailed", passphrase_failed); | 357 args.SetBoolean("passphraseFailed", passphrase_failed); |
| 357 args.SetBoolean("showSyncEverythingPage", !show_advanced); | 358 args.SetBoolean("showSyncEverythingPage", !show_advanced); |
| 358 args.SetBoolean("syncAllDataTypes", sync_prefs.HasKeepEverythingSynced()); | 359 args.SetBoolean("syncAllDataTypes", sync_prefs.HasKeepEverythingSynced()); |
| 359 args.SetBoolean("syncNothing", false); // Always false during initial setup. | 360 args.SetBoolean("syncNothing", false); // Always false during initial setup. |
| 360 args.SetBoolean("encryptAllData", service->EncryptEverythingEnabled()); | 361 args.SetBoolean("encryptAllData", service->EncryptEverythingEnabled()); |
| 361 | 362 |
| 362 // We call IsPassphraseRequired() here, instead of calling | 363 // We call IsPassphraseRequired() here, instead of calling |
| 363 // IsPassphraseRequiredForDecryption(), because we want to show the passphrase | 364 // IsPassphraseRequiredForDecryption(), because we want to show the passphrase |
| 364 // UI even if no encrypted data types are enabled. | 365 // UI even if no encrypted data types are enabled. |
| 365 args.SetBoolean("showPassphrase", service->IsPassphraseRequired()); | 366 args.SetBoolean("showPassphrase", service->IsPassphraseRequired()); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 | 910 |
| 910 LoginUIService* service = GetLoginUIService(); | 911 LoginUIService* service = GetLoginUIService(); |
| 911 DCHECK(service); | 912 DCHECK(service); |
| 912 service->current_login_ui()->FocusUI(); | 913 service->current_login_ui()->FocusUI(); |
| 913 return true; | 914 return true; |
| 914 } | 915 } |
| 915 | 916 |
| 916 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 917 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
| 917 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 918 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
| 918 } | 919 } |
| OLD | NEW |