OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/extensions/external_component_loader.h" | 5 #include "chrome/browser/extensions/external_component_loader.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/search/hotword_service_factory.h" | 12 #include "chrome/browser/search/hotword_service_factory.h" |
13 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
16 #include "components/signin/core/browser/signin_manager.h" | 16 #include "components/signin/core/browser/signin_manager.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 bool IsUserSignedin(Profile* profile) { | 20 bool IsUserSignedin(Profile* profile) { |
21 SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); | 21 SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); |
22 return signin && !signin->GetAuthenticatedUsername().empty(); | 22 return signin && signin->IsAuthenticated(); |
23 } | 23 } |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 namespace extensions { | 27 namespace extensions { |
28 | 28 |
29 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) | 29 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) |
30 : profile_(profile) { | 30 : profile_(profile) { |
31 } | 31 } |
32 | 32 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) && | 75 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) && |
76 !ext_id.empty()) { | 76 !ext_id.empty()) { |
77 prefs_->SetString(ext_id + ".external_update_url", | 77 prefs_->SetString(ext_id + ".external_update_url", |
78 extension_urls::GetWebstoreUpdateUrl().spec()); | 78 extension_urls::GetWebstoreUpdateUrl().spec()); |
79 } | 79 } |
80 | 80 |
81 LoadFinished(); | 81 LoadFinished(); |
82 } | 82 } |
83 | 83 |
84 } // namespace extensions | 84 } // namespace extensions |
OLD | NEW |