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

Side by Side Diff: chrome/browser/history/web_history_service_factory.cc

Issue 14344002: Sync: Turn on full history sync by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix use-after-free. Created 7 years, 7 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/history/web_history_service_factory.h" 5 #include "chrome/browser/history/web_history_service_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/content_settings/cookie_settings.h" 8 #include "chrome/browser/content_settings/cookie_settings.h"
9 #include "chrome/browser/history/web_history_service.h" 9 #include "chrome/browser/history/web_history_service.h"
10 #include "chrome/browser/profiles/profile_dependency_manager.h" 10 #include "chrome/browser/profiles/profile_dependency_manager.h"
11 #include "chrome/browser/signin/token_service_factory.h" 11 #include "chrome/browser/signin/token_service_factory.h"
12 #include "chrome/browser/sync/profile_sync_service.h" 12 #include "chrome/browser/sync/profile_sync_service.h"
13 #include "chrome/browser/sync/profile_sync_service_factory.h" 13 #include "chrome/browser/sync/profile_sync_service_factory.h"
14 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 15
16 namespace { 16 namespace {
17 // Returns true if the user is signed in and full history sync is enabled, 17 // Returns true if the user is signed in and full history sync is enabled,
18 // and false otherwise. 18 // and false otherwise.
19 bool IsHistorySyncEnabled(Profile* profile) { 19 bool IsHistorySyncEnabled(Profile* profile) {
20 if (CommandLine::ForCurrentProcess()->HasSwitch( 20 if (!CommandLine::ForCurrentProcess()->HasSwitch(
21 switches::kHistoryEnableFullHistorySync)) { 21 switches::kHistoryDisableFullHistorySync)) {
22 ProfileSyncService* sync = 22 ProfileSyncService* sync =
23 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); 23 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
24 return sync && 24 return sync &&
25 sync->GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); 25 sync->GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES);
26 } 26 }
27 return false; 27 return false;
28 } 28 }
29 29
30 } // namespace 30 } // namespace
31 31
(...skipping 22 matching lines...) Expand all
54 54
55 WebHistoryServiceFactory::WebHistoryServiceFactory() 55 WebHistoryServiceFactory::WebHistoryServiceFactory()
56 : ProfileKeyedServiceFactory("WebHistoryServiceFactory", 56 : ProfileKeyedServiceFactory("WebHistoryServiceFactory",
57 ProfileDependencyManager::GetInstance()) { 57 ProfileDependencyManager::GetInstance()) {
58 DependsOn(TokenServiceFactory::GetInstance()); 58 DependsOn(TokenServiceFactory::GetInstance());
59 DependsOn(CookieSettings::Factory::GetInstance()); 59 DependsOn(CookieSettings::Factory::GetInstance());
60 } 60 }
61 61
62 WebHistoryServiceFactory::~WebHistoryServiceFactory() { 62 WebHistoryServiceFactory::~WebHistoryServiceFactory() {
63 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/history/web_history_service.cc ('k') | chrome/browser/sync/profile_sync_components_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698