OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/android/offline_pages/prerendering_offliner.h" | 5 #include "chrome/browser/android/offline_pages/prerendering_offliner.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" | 10 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
11 #include "chrome/browser/net/prediction_options.h" | 11 #include "chrome/browser/net/prediction_options.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "components/content_settings/core/common/pref_names.h" | 14 #include "components/content_settings/core/common/pref_names.h" |
15 #include "components/offline_pages/background/save_page_request.h" | 15 #include "components/offline_pages/core/background/save_page_request.h" |
16 #include "components/offline_pages/client_namespace_constants.h" | 16 #include "components/offline_pages/core/client_namespace_constants.h" |
17 #include "components/offline_pages/offline_page_model.h" | 17 #include "components/offline_pages/core/offline_page_model.h" |
18 #include "components/prefs/pref_service.h" | 18 #include "components/prefs/pref_service.h" |
19 #include "content/public/browser/browser_context.h" | 19 #include "content/public/browser/browser_context.h" |
20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 bool AreThirdPartyCookiesBlocked(content::BrowserContext* browser_context) { | 24 bool AreThirdPartyCookiesBlocked(content::BrowserContext* browser_context) { |
25 return Profile::FromBrowserContext(browser_context) | 25 return Profile::FromBrowserContext(browser_context) |
26 ->GetPrefs() | 26 ->GetPrefs() |
27 ->GetBoolean(prefs::kBlockThirdPartyCookies); | 27 ->GetBoolean(prefs::kBlockThirdPartyCookies); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { | 268 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { |
269 DVLOG(1) << "App became active, canceling current offlining request"; | 269 DVLOG(1) << "App became active, canceling current offlining request"; |
270 SavePageRequest* request = pending_request_.get(); | 270 SavePageRequest* request = pending_request_.get(); |
271 Cancel(); | 271 Cancel(); |
272 completion_callback_.Run(*request, | 272 completion_callback_.Run(*request, |
273 Offliner::RequestStatus::FOREGROUND_CANCELED); | 273 Offliner::RequestStatus::FOREGROUND_CANCELED); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 } // namespace offline_pages | 277 } // namespace offline_pages |
OLD | NEW |