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/bookmarks/bookmark_model_factory.h" | 5 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/deferred_sequenced_task_runner.h" | 8 #include "base/deferred_sequenced_task_runner.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 bookmark_model->Load(profile->GetPrefs(), | 63 bookmark_model->Load(profile->GetPrefs(), |
64 profile->GetPrefs()->GetString(prefs::kAcceptLanguages), | 64 profile->GetPrefs()->GetString(prefs::kAcceptLanguages), |
65 profile->GetPath(), | 65 profile->GetPath(), |
66 StartupTaskRunnerServiceFactory::GetForProfile(profile) | 66 StartupTaskRunnerServiceFactory::GetForProfile(profile) |
67 ->GetBookmarkTaskRunner(), | 67 ->GetBookmarkTaskRunner(), |
68 content::BrowserThread::GetMessageLoopProxyForThread( | 68 content::BrowserThread::GetMessageLoopProxyForThread( |
69 content::BrowserThread::UI)); | 69 content::BrowserThread::UI)); |
70 bool register_bookmark_undo_service_as_observer = true; | 70 bool register_bookmark_undo_service_as_observer = true; |
71 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 71 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
72 register_bookmark_undo_service_as_observer = | 72 register_bookmark_undo_service_as_observer = |
73 CommandLine::ForCurrentProcess()->HasSwitch( | 73 base::CommandLine::ForCurrentProcess()->HasSwitch( |
74 switches::kEnableBookmarkUndo); | 74 switches::kEnableBookmarkUndo); |
75 #endif // !defined(OS_IOS) | 75 #endif // !defined(OS_IOS) |
76 if (register_bookmark_undo_service_as_observer) { | 76 if (register_bookmark_undo_service_as_observer) { |
77 bookmark_model->AddObserver( | 77 bookmark_model->AddObserver( |
78 BookmarkUndoServiceFactory::GetForProfile(profile)); | 78 BookmarkUndoServiceFactory::GetForProfile(profile)); |
79 } | 79 } |
80 return bookmark_model; | 80 return bookmark_model; |
81 } | 81 } |
82 | 82 |
83 void BookmarkModelFactory::RegisterProfilePrefs( | 83 void BookmarkModelFactory::RegisterProfilePrefs( |
(...skipping 11 matching lines...) Expand all Loading... |
95 } | 95 } |
96 | 96 |
97 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( | 97 content::BrowserContext* BookmarkModelFactory::GetBrowserContextToUse( |
98 content::BrowserContext* context) const { | 98 content::BrowserContext* context) const { |
99 return chrome::GetBrowserContextRedirectedInIncognito(context); | 99 return chrome::GetBrowserContextRedirectedInIncognito(context); |
100 } | 100 } |
101 | 101 |
102 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { | 102 bool BookmarkModelFactory::ServiceIsNULLWhileTesting() const { |
103 return true; | 103 return true; |
104 } | 104 } |
OLD | NEW |