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

Unified Diff: chrome/browser/importer/importer_host.cc

Issue 7390027: Added group policies to enable/disable importing of data from other browsers. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/importer_host.cc
diff --git a/chrome/browser/importer/importer_host.cc b/chrome/browser/importer/importer_host.cc
index 39fc5d76ecebdcb6e4e9115a883d242817b3ff21..385c426d21db43aaa28d125fccc01b6a80dd5fa9 100644
--- a/chrome/browser/importer/importer_host.cc
+++ b/chrome/browser/importer/importer_host.cc
@@ -15,12 +15,14 @@
#include "chrome/browser/importer/importer_type.h"
#include "chrome/browser/importer/in_process_importer_bridge.h"
#include "chrome/browser/importer/toolbar_importer_utils.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/pref_names.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_source.h"
#include "grit/generated_resources.h"
@@ -109,6 +111,18 @@ void ImporterHost::StartImportSettings(
DCHECK(target_profile);
profile_ = target_profile;
+ PrefService* user_prefs = profile_->GetPrefs();
+
+ // Make sure only items that were not disabled by policy are imported.
+ if (!user_prefs->GetBoolean(prefs::kImportHistory))
+ items &= ~importer::HISTORY;
+ if (!user_prefs->GetBoolean(prefs::kImportSearchEngine))
+ items &= ~importer::SEARCH_ENGINES;
+ if (!user_prefs->GetBoolean(prefs::kImportBookmarks))
+ items &= ~importer::FAVORITES;
+ if (!user_prefs->GetBoolean(prefs::kImportSavedPasswords))
+ items &= ~importer::PASSWORDS;
+
// Preserves the observer and creates a task, since we do async import so that
// it doesn't block the UI. When the import is complete, observer will be
// notified.
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698