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 #ifndef CHROME_BROWSER_UI_WEBUI_OFFLINE_OFFLINE_INTERNALS_UI_MESSAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OFFLINE_OFFLINE_INTERNALS_UI_MESSAGE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OFFLINE_OFFLINE_INTERNALS_UI_MESSAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OFFLINE_OFFLINE_INTERNALS_UI_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/offline_pages/background/request_coordinator.h" | 10 #include "components/offline_pages/background/request_coordinator.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Callback for async GetAllPages calls. | 57 // Callback for async GetAllPages calls. |
58 void HandleStoredPagesCallback( | 58 void HandleStoredPagesCallback( |
59 std::string callback_id, | 59 std::string callback_id, |
60 const offline_pages::MultipleOfflinePageItemResult& pages); | 60 const offline_pages::MultipleOfflinePageItemResult& pages); |
61 | 61 |
62 // Callback for async GetRequests calls. | 62 // Callback for async GetRequests calls. |
63 void HandleRequestQueueCallback( | 63 void HandleRequestQueueCallback( |
64 std::string callback_id, | 64 std::string callback_id, |
65 offline_pages::RequestQueue::GetRequestsResult result, | 65 offline_pages::RequestQueue::GetRequestsResult result, |
66 const std::vector<offline_pages::SavePageRequest>& requests); | 66 std::vector<std::unique_ptr<offline_pages::SavePageRequest>> requests); |
67 | 67 |
68 // Callback for DeletePage/ClearAll calls. | 68 // Callback for DeletePage/ClearAll calls. |
69 void HandleDeletedPagesCallback(std::string callback_id, | 69 void HandleDeletedPagesCallback(std::string callback_id, |
70 const offline_pages::DeletePageResult result); | 70 const offline_pages::DeletePageResult result); |
71 | 71 |
72 // Turns a DeletePageResult enum into logical string. | 72 // Turns a DeletePageResult enum into logical string. |
73 std::string GetStringFromDeletePageResult( | 73 std::string GetStringFromDeletePageResult( |
74 offline_pages::DeletePageResult value); | 74 offline_pages::DeletePageResult value); |
75 | 75 |
76 // Turns a SavePageRequest::Status into logical string. | 76 // Turns a SavePageRequest::Status into logical string. |
77 std::string GetStringFromSavePageStatus(); | 77 std::string GetStringFromSavePageStatus(); |
78 | 78 |
79 // Offline page model to call methods on. | 79 // Offline page model to call methods on. |
80 offline_pages::OfflinePageModel* offline_page_model_; | 80 offline_pages::OfflinePageModel* offline_page_model_; |
81 | 81 |
82 // Request coordinator for background offline actions. | 82 // Request coordinator for background offline actions. |
83 offline_pages::RequestCoordinator* request_coordinator_; | 83 offline_pages::RequestCoordinator* request_coordinator_; |
84 | 84 |
85 // Factory for creating references in callbacks. | 85 // Factory for creating references in callbacks. |
86 base::WeakPtrFactory<OfflineInternalsUIMessageHandler> weak_ptr_factory_; | 86 base::WeakPtrFactory<OfflineInternalsUIMessageHandler> weak_ptr_factory_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(OfflineInternalsUIMessageHandler); | 88 DISALLOW_COPY_AND_ASSIGN(OfflineInternalsUIMessageHandler); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace offline_internals | 91 } // namespace offline_internals |
92 | 92 |
93 #endif // CHROME_BROWSER_UI_WEBUI_OFFLINE_OFFLINE_INTERNALS_UI_MESSAGE_HANDLER_H
_ | 93 #endif // CHROME_BROWSER_UI_WEBUI_OFFLINE_OFFLINE_INTERNALS_UI_MESSAGE_HANDLER_H
_ |
OLD | NEW |