OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync/profile_signin_confirmation_helper.h" | 5 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
11 #include "chrome/browser/history/history_service_factory.h" | 11 #include "chrome/browser/history/history_service_factory.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "components/bookmarks/browser/bookmark_model.h" | 13 #include "components/bookmarks/browser/bookmark_model.h" |
14 #include "components/browser_sync/signin_confirmation_helper.h" | 14 #include "components/browser_sync/signin_confirmation_helper.h" |
15 #include "components/history/core/browser/history_service.h" | 15 #include "components/history/core/browser/history_service.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "extensions/features/features.h" |
17 #include "ui/gfx/color_utils.h" | 18 #include "ui/gfx/color_utils.h" |
18 #include "ui/native_theme/native_theme.h" | 19 #include "ui/native_theme/native_theme.h" |
19 | 20 |
20 #if defined(ENABLE_EXTENSIONS) | 21 #if BUILDFLAG(ENABLE_EXTENSIONS) |
21 #include "chrome/common/extensions/extension_constants.h" | 22 #include "chrome/common/extensions/extension_constants.h" |
22 #include "chrome/common/extensions/sync_helper.h" | 23 #include "chrome/common/extensions/sync_helper.h" |
23 #include "extensions/browser/extension_registry.h" | 24 #include "extensions/browser/extension_registry.h" |
24 #include "extensions/common/constants.h" | 25 #include "extensions/common/constants.h" |
25 #include "extensions/common/extension.h" | 26 #include "extensions/common/extension.h" |
26 #include "extensions/common/extension_set.h" | 27 #include "extensions/common/extension_set.h" |
27 #endif | 28 #endif |
28 | 29 |
29 using bookmarks::BookmarkModel; | 30 using bookmarks::BookmarkModel; |
30 | 31 |
(...skipping 22 matching lines...) Expand all Loading... |
53 } | 54 } |
54 | 55 |
55 bool HasBeenShutdown(Profile* profile) { | 56 bool HasBeenShutdown(Profile* profile) { |
56 bool has_been_shutdown = !profile->IsNewProfile(); | 57 bool has_been_shutdown = !profile->IsNewProfile(); |
57 if (has_been_shutdown) | 58 if (has_been_shutdown) |
58 DVLOG(1) << "ProfileSigninConfirmationHelper: profile is not new"; | 59 DVLOG(1) << "ProfileSigninConfirmationHelper: profile is not new"; |
59 return has_been_shutdown; | 60 return has_been_shutdown; |
60 } | 61 } |
61 | 62 |
62 bool HasSyncedExtensions(Profile* profile) { | 63 bool HasSyncedExtensions(Profile* profile) { |
63 #if defined(ENABLE_EXTENSIONS) | 64 #if BUILDFLAG(ENABLE_EXTENSIONS) |
64 extensions::ExtensionRegistry* registry = | 65 extensions::ExtensionRegistry* registry = |
65 extensions::ExtensionRegistry::Get(profile); | 66 extensions::ExtensionRegistry::Get(profile); |
66 if (registry) { | 67 if (registry) { |
67 for (const scoped_refptr<const extensions::Extension>& extension : | 68 for (const scoped_refptr<const extensions::Extension>& extension : |
68 registry->enabled_extensions()) { | 69 registry->enabled_extensions()) { |
69 // The webstore is synced so that it stays put on the new tab | 70 // The webstore is synced so that it stays put on the new tab |
70 // page, but since it's installed by default we don't want to | 71 // page, but since it's installed by default we don't want to |
71 // consider it when determining if the profile is dirty. | 72 // consider it when determining if the profile is dirty. |
72 if (extensions::sync_helper::IsSyncable(extension.get()) && | 73 if (extensions::sync_helper::IsSyncable(extension.get()) && |
73 !extensions::sync_helper::IsSyncableComponentExtension( | 74 !extensions::sync_helper::IsSyncableComponentExtension( |
(...skipping 22 matching lines...) Expand all Loading... |
96 history::HistoryService* service = | 97 history::HistoryService* service = |
97 HistoryServiceFactory::GetForProfileWithoutCreating(profile); | 98 HistoryServiceFactory::GetForProfileWithoutCreating(profile); |
98 // Fire asynchronous queries for profile data. | 99 // Fire asynchronous queries for profile data. |
99 browser_sync::SigninConfirmationHelper* helper = | 100 browser_sync::SigninConfirmationHelper* helper = |
100 new browser_sync::SigninConfirmationHelper(service, return_result); | 101 new browser_sync::SigninConfirmationHelper(service, return_result); |
101 helper->CheckHasHistory(kHistoryEntriesBeforeNewProfilePrompt); | 102 helper->CheckHasHistory(kHistoryEntriesBeforeNewProfilePrompt); |
102 helper->CheckHasTypedURLs(); | 103 helper->CheckHasTypedURLs(); |
103 } | 104 } |
104 | 105 |
105 } // namespace ui | 106 } // namespace ui |
OLD | NEW |