| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void CanDownload(const GURL& url, | 71 void CanDownload(const GURL& url, |
| 72 const std::string& request_method, | 72 const std::string& request_method, |
| 73 const base::Callback<void(bool)>& callback) override { | 73 const base::Callback<void(bool)>& callback) override { |
| 74 on_failed_callback_.Run(); | 74 on_failed_callback_.Run(); |
| 75 // Cancel the download. | 75 // Cancel the download. |
| 76 callback.Run(false); | 76 callback.Run(false); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool ShouldCreateWebContents( | 79 bool ShouldCreateWebContents( |
| 80 WebContents* web_contents, | 80 WebContents* web_contents, |
| 81 int route_id, | 81 int32 route_id, |
| 82 int main_frame_route_id, | 82 int32 main_frame_route_id, |
| 83 int32 main_frame_widget_route_id, |
| 83 WindowContainerType window_container_type, | 84 WindowContainerType window_container_type, |
| 84 const std::string& frame_name, | 85 const std::string& frame_name, |
| 85 const GURL& target_url, | 86 const GURL& target_url, |
| 86 const std::string& partition_id, | 87 const std::string& partition_id, |
| 87 SessionStorageNamespace* session_storage_namespace) override { | 88 SessionStorageNamespace* session_storage_namespace) override { |
| 88 // Since we don't want to permit child windows that would have a | 89 // Since we don't want to permit child windows that would have a |
| 89 // window.opener property, terminate rendering. | 90 // window.opener property, terminate rendering. |
| 90 on_failed_callback_.Run(); | 91 on_failed_callback_.Run(); |
| 91 // Cancel the popup. | 92 // Cancel the popup. |
| 92 return false; | 93 return false; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 WebContents* source_web_contents) { | 261 WebContents* source_web_contents) { |
| 261 // TODO(ajwong): Remove the temporary map once prerendering is aware of | 262 // TODO(ajwong): Remove the temporary map once prerendering is aware of |
| 262 // multiple session storage namespaces per tab. | 263 // multiple session storage namespaces per tab. |
| 263 content::SessionStorageNamespaceMap session_storage_namespace_map; | 264 content::SessionStorageNamespaceMap session_storage_namespace_map; |
| 264 Profile* profile = | 265 Profile* profile = |
| 265 Profile::FromBrowserContext(source_web_contents->GetBrowserContext()); | 266 Profile::FromBrowserContext(source_web_contents->GetBrowserContext()); |
| 266 session_storage_namespace_map[std::string()] = session_storage_namespace; | 267 session_storage_namespace_map[std::string()] = session_storage_namespace; |
| 267 return WebContents::CreateWithSessionStorage( | 268 return WebContents::CreateWithSessionStorage( |
| 268 WebContents::CreateParams(profile), session_storage_namespace_map); | 269 WebContents::CreateParams(profile), session_storage_namespace_map); |
| 269 } | 270 } |
| OLD | NEW |