| 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 "components/offline_pages/content/background_loader/background_loader_c
ontents.h" | 5 #include "components/offline_pages/content/background_loader/background_loader_c
ontents.h" |
| 6 | 6 |
| 7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
| 8 | 8 |
| 9 namespace background_loader { | 9 namespace background_loader { |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void BackgroundLoaderContents::CanDownload( | 55 void BackgroundLoaderContents::CanDownload( |
| 56 const GURL& url, | 56 const GURL& url, |
| 57 const std::string& request_method, | 57 const std::string& request_method, |
| 58 const base::Callback<void(bool)>& callback) { | 58 const base::Callback<void(bool)>& callback) { |
| 59 // Do not download anything. | 59 // Do not download anything. |
| 60 callback.Run(false); | 60 callback.Run(false); |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool BackgroundLoaderContents::ShouldCreateWebContents( | 63 bool BackgroundLoaderContents::ShouldCreateWebContents( |
| 64 content::WebContents* contents, | 64 content::WebContents* web_contents, |
| 65 content::SiteInstance* source_site_instance, |
| 65 int32_t route_id, | 66 int32_t route_id, |
| 66 int32_t main_frame_route_id, | 67 int32_t main_frame_route_id, |
| 67 int32_t main_frame_widget_route_id, | 68 int32_t main_frame_widget_route_id, |
| 68 WindowContainerType window_container_type, | 69 WindowContainerType window_container_type, |
| 70 const GURL& opener_url, |
| 69 const std::string& frame_name, | 71 const std::string& frame_name, |
| 70 const GURL& target_url, | 72 const GURL& target_url, |
| 71 const std::string& partition_id, | 73 const std::string& partition_id, |
| 72 content::SessionStorageNamespace* session_storage_namespace) { | 74 content::SessionStorageNamespace* session_storage_namespace) { |
| 73 // Background pages should not create other webcontents/tabs. | 75 // Background pages should not create other webcontents/tabs. |
| 74 return false; | 76 return false; |
| 75 } | 77 } |
| 76 | 78 |
| 77 void BackgroundLoaderContents::AddNewContents( | 79 void BackgroundLoaderContents::AddNewContents( |
| 78 content::WebContents* source, | 80 content::WebContents* source, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 content::MediaStreamType type) { | 113 content::MediaStreamType type) { |
| 112 return false; // No permissions granted. | 114 return false; // No permissions granted. |
| 113 } | 115 } |
| 114 | 116 |
| 115 BackgroundLoaderContents::BackgroundLoaderContents() | 117 BackgroundLoaderContents::BackgroundLoaderContents() |
| 116 : browser_context_(nullptr) { | 118 : browser_context_(nullptr) { |
| 117 web_contents_.reset(); | 119 web_contents_.reset(); |
| 118 } | 120 } |
| 119 | 121 |
| 120 } // namespace background_loader | 122 } // namespace background_loader |
| OLD | NEW |