OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/recent_tab_helper.h" | 5 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "chrome/browser/android/offline_pages/downloads/offline_page_notificati
on_bridge.h" | 18 #include "chrome/browser/android/offline_pages/downloads/offline_page_notificati
on_bridge.h" |
19 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" | 19 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
20 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" | 20 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
21 #include "chrome/browser/android/offline_pages/offline_page_utils.h" | 21 #include "chrome/browser/android/offline_pages/offline_page_utils.h" |
22 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" | 22 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" |
23 #include "components/offline_pages/background/request_coordinator.h" | 23 #include "components/offline_pages/core/background/request_coordinator.h" |
24 #include "components/offline_pages/client_namespace_constants.h" | 24 #include "components/offline_pages/core/client_namespace_constants.h" |
25 #include "components/offline_pages/offline_page_feature.h" | 25 #include "components/offline_pages/core/offline_page_feature.h" |
26 #include "components/offline_pages/offline_page_item.h" | 26 #include "components/offline_pages/core/offline_page_item.h" |
27 #include "components/offline_pages/offline_page_model.h" | 27 #include "components/offline_pages/core/offline_page_model.h" |
28 #include "content/public/browser/browser_context.h" | 28 #include "content/public/browser/browser_context.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "content/public/browser/navigation_entry.h" | 30 #include "content/public/browser/navigation_entry.h" |
31 #include "content/public/browser/navigation_handle.h" | 31 #include "content/public/browser/navigation_handle.h" |
32 | 32 |
33 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::RecentTabHelper); | 33 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::RecentTabHelper); |
34 | 34 |
35 namespace { | 35 namespace { |
36 class DefaultDelegate: public offline_pages::RecentTabHelper::Delegate { | 36 class DefaultDelegate: public offline_pages::RecentTabHelper::Delegate { |
37 public: | 37 public: |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 bool RecentTabHelper::IsSamePage() const { | 293 bool RecentTabHelper::IsSamePage() const { |
294 return web_contents() && | 294 return web_contents() && |
295 (web_contents()->GetLastCommittedURL() == snapshot_url_); | 295 (web_contents()->GetLastCommittedURL() == snapshot_url_); |
296 } | 296 } |
297 | 297 |
298 ClientId RecentTabHelper::GetRecentPagesClientId() const { | 298 ClientId RecentTabHelper::GetRecentPagesClientId() const { |
299 return ClientId(kLastNNamespace, tab_id_); | 299 return ClientId(kLastNNamespace, tab_id_); |
300 } | 300 } |
301 | 301 |
302 } // namespace offline_pages | 302 } // namespace offline_pages |
OLD | NEW |