OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (StartsWithASCII(download_url.spec(), | 97 if (StartsWithASCII(download_url.spec(), |
98 extension_urls::kMiniGalleryDownloadPrefix, false) && | 98 extension_urls::kMiniGalleryDownloadPrefix, false) && |
99 StartsWithASCII(referrer_url.spec(), | 99 StartsWithASCII(referrer_url.spec(), |
100 extension_urls::kMiniGalleryBrowsePrefix, false)) { | 100 extension_urls::kMiniGalleryBrowsePrefix, false)) { |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 if (StartsWithASCII(download_url.spec(), | 104 if (StartsWithASCII(download_url.spec(), |
105 extension_urls::kGalleryDownloadPrefix, false) && | 105 extension_urls::kGalleryDownloadPrefix, false) && |
106 StartsWithASCII(referrer_url.spec(), | 106 StartsWithASCII(referrer_url.spec(), |
107 extension_urls::kGalleryBrowsePrefix, false)) { | 107 Extension::ChromeStoreURL(), false)) { |
108 return true; | 108 return true; |
109 } | 109 } |
110 | 110 |
111 // Allow command line gallery url to be referrer for the gallery downloads. | 111 // Allow command line gallery url to be referrer for the gallery downloads. |
112 std::string command_line_gallery_url = | 112 std::string command_line_gallery_url = |
113 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 113 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
114 switches::kAppsGalleryURL); | 114 switches::kAppsGalleryURL); |
115 if (!command_line_gallery_url.empty() && | 115 if (!command_line_gallery_url.empty() && |
116 StartsWithASCII(download_url.spec(), | 116 StartsWithASCII(download_url.spec(), |
117 extension_urls::kGalleryDownloadPrefix, false) && | 117 extension_urls::kGalleryDownloadPrefix, false) && |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 // Finish installing on UI thread. | 1221 // Finish installing on UI thread. |
1222 ChromeThread::PostTask( | 1222 ChromeThread::PostTask( |
1223 ChromeThread::UI, FROM_HERE, | 1223 ChromeThread::UI, FROM_HERE, |
1224 NewRunnableMethod( | 1224 NewRunnableMethod( |
1225 frontend_, | 1225 frontend_, |
1226 &ExtensionsService::ContinueLoadAllExtensions, | 1226 &ExtensionsService::ContinueLoadAllExtensions, |
1227 extensions_to_reload, | 1227 extensions_to_reload, |
1228 start_time, | 1228 start_time, |
1229 true)); | 1229 true)); |
1230 } | 1230 } |
OLD | NEW |