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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 195873020: [Sync] Move SyncPrefs into sync_driver component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rerererebase Created 6 years, 9 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
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/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
32 #include "chrome/browser/ui/browser_navigator.h" 32 #include "chrome/browser/ui/browser_navigator.h"
33 #include "chrome/browser/ui/singleton_tabs.h" 33 #include "chrome/browser/ui/singleton_tabs.h"
34 #include "chrome/browser/ui/sync/signin_histogram.h" 34 #include "chrome/browser/ui/sync/signin_histogram.h"
35 #include "chrome/browser/ui/webui/signin/login_ui_service.h" 35 #include "chrome/browser/ui/webui/signin/login_ui_service.h"
36 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 36 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
37 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/pref_names.h" 38 #include "chrome/common/pref_names.h"
39 #include "chrome/common/url_constants.h" 39 #include "chrome/common/url_constants.h"
40 #include "components/signin/core/profile_oauth2_token_service.h" 40 #include "components/signin/core/profile_oauth2_token_service.h"
41 #include "components/signin/core/signin_error_controller.h" 41 #include "components/signin/core/signin_error_controller.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
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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 911
911 LoginUIService* service = GetLoginUIService(); 912 LoginUIService* service = GetLoginUIService();
912 DCHECK(service); 913 DCHECK(service);
913 service->current_login_ui()->FocusUI(); 914 service->current_login_ui()->FocusUI();
914 return true; 915 return true;
915 } 916 }
916 917
917 LoginUIService* SyncSetupHandler::GetLoginUIService() const { 918 LoginUIService* SyncSetupHandler::GetLoginUIService() const {
918 return LoginUIServiceFactory::GetForProfile(GetProfile()); 919 return LoginUIServiceFactory::GetForProfile(GetProfile());
919 } 920 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/browser/ui/webui/sync_setup_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698