| 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, |
| 82 int32 surface_id, |
| 81 WindowContainerType window_container_type, | 83 WindowContainerType window_container_type, |
| 82 const std::string& frame_name, | 84 const std::string& frame_name, |
| 83 const GURL& target_url, | 85 const GURL& target_url, |
| 84 const std::string& partition_id, | 86 const std::string& partition_id, |
| 85 SessionStorageNamespace* session_storage_namespace) override { | 87 SessionStorageNamespace* session_storage_namespace) override { |
| 86 // Since we don't want to permit child windows that would have a | 88 // Since we don't want to permit child windows that would have a |
| 87 // window.opener property, terminate rendering. | 89 // window.opener property, terminate rendering. |
| 88 on_failed_callback_.Run(); | 90 on_failed_callback_.Run(); |
| 89 // Cancel the popup. | 91 // Cancel the popup. |
| 90 return false; | 92 return false; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 WebContents* source_web_contents) { | 258 WebContents* source_web_contents) { |
| 257 // TODO(ajwong): Remove the temporary map once prerendering is aware of | 259 // TODO(ajwong): Remove the temporary map once prerendering is aware of |
| 258 // multiple session storage namespaces per tab. | 260 // multiple session storage namespaces per tab. |
| 259 content::SessionStorageNamespaceMap session_storage_namespace_map; | 261 content::SessionStorageNamespaceMap session_storage_namespace_map; |
| 260 Profile* profile = | 262 Profile* profile = |
| 261 Profile::FromBrowserContext(source_web_contents->GetBrowserContext()); | 263 Profile::FromBrowserContext(source_web_contents->GetBrowserContext()); |
| 262 session_storage_namespace_map[std::string()] = session_storage_namespace; | 264 session_storage_namespace_map[std::string()] = session_storage_namespace; |
| 263 return WebContents::CreateWithSessionStorage( | 265 return WebContents::CreateWithSessionStorage( |
| 264 WebContents::CreateParams(profile), session_storage_namespace_map); | 266 WebContents::CreateParams(profile), session_storage_namespace_map); |
| 265 } | 267 } |
| OLD | NEW |