OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/webui/print_preview/print_preview_distiller.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_distiller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void CanDownload(const GURL& url, | 69 void CanDownload(const GURL& url, |
70 const std::string& request_method, | 70 const std::string& request_method, |
71 const base::Callback<void(bool)>& callback) override { | 71 const base::Callback<void(bool)>& callback) override { |
72 on_failed_callback_.Run(); | 72 on_failed_callback_.Run(); |
73 // Cancel the download. | 73 // Cancel the download. |
74 callback.Run(false); | 74 callback.Run(false); |
75 } | 75 } |
76 | 76 |
77 bool ShouldCreateWebContents( | 77 bool ShouldCreateWebContents( |
78 WebContents* web_contents, | 78 WebContents* web_contents, |
79 int route_id, | 79 int32 route_id, |
80 int main_frame_route_id, | 80 int32 main_frame_route_id, |
| 81 int32 main_frame_widget_route_id, |
81 WindowContainerType window_container_type, | 82 WindowContainerType window_container_type, |
82 const std::string& frame_name, | 83 const std::string& frame_name, |
83 const GURL& target_url, | 84 const GURL& target_url, |
84 const std::string& partition_id, | 85 const std::string& partition_id, |
85 SessionStorageNamespace* session_storage_namespace) override { | 86 SessionStorageNamespace* session_storage_namespace) override { |
86 // Since we don't want to permit child windows that would have a | 87 // Since we don't want to permit child windows that would have a |
87 // window.opener property, terminate rendering. | 88 // window.opener property, terminate rendering. |
88 on_failed_callback_.Run(); | 89 on_failed_callback_.Run(); |
89 // Cancel the popup. | 90 // Cancel the popup. |
90 return false; | 91 return false; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 WebContents* source_web_contents) { | 257 WebContents* source_web_contents) { |
257 // TODO(ajwong): Remove the temporary map once prerendering is aware of | 258 // TODO(ajwong): Remove the temporary map once prerendering is aware of |
258 // multiple session storage namespaces per tab. | 259 // multiple session storage namespaces per tab. |
259 content::SessionStorageNamespaceMap session_storage_namespace_map; | 260 content::SessionStorageNamespaceMap session_storage_namespace_map; |
260 Profile* profile = | 261 Profile* profile = |
261 Profile::FromBrowserContext(source_web_contents->GetBrowserContext()); | 262 Profile::FromBrowserContext(source_web_contents->GetBrowserContext()); |
262 session_storage_namespace_map[std::string()] = session_storage_namespace; | 263 session_storage_namespace_map[std::string()] = session_storage_namespace; |
263 return WebContents::CreateWithSessionStorage( | 264 return WebContents::CreateWithSessionStorage( |
264 WebContents::CreateParams(profile), session_storage_namespace_map); | 265 WebContents::CreateParams(profile), session_storage_namespace_map); |
265 } | 266 } |
OLD | NEW |