| 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/extensions/api/tab_capture/offscreen_presentation.h" | 5 #include "chrome/browser/extensions/api/tab_capture/offscreen_presentation.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" | 10 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 const content::DropData& data, | 300 const content::DropData& data, |
| 301 blink::WebDragOperationsMask operations_allowed) { | 301 blink::WebDragOperationsMask operations_allowed) { |
| 302 DCHECK_EQ(presentation_web_contents_.get(), source); | 302 DCHECK_EQ(presentation_web_contents_.get(), source); |
| 303 // Halt all drag attempts onto the page since there should be no direct user | 303 // Halt all drag attempts onto the page since there should be no direct user |
| 304 // interaction with it. | 304 // interaction with it. |
| 305 return false; | 305 return false; |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool OffscreenPresentation::ShouldCreateWebContents( | 308 bool OffscreenPresentation::ShouldCreateWebContents( |
| 309 WebContents* contents, | 309 WebContents* contents, |
| 310 int route_id, | 310 int32 route_id, |
| 311 int main_frame_route_id, | 311 int32 main_frame_route_id, |
| 312 int32 main_frame_widget_route_id, |
| 313 int32 surface_id, |
| 312 WindowContainerType window_container_type, | 314 WindowContainerType window_container_type, |
| 313 const std::string& frame_name, | 315 const std::string& frame_name, |
| 314 const GURL& target_url, | 316 const GURL& target_url, |
| 315 const std::string& partition_id, | 317 const std::string& partition_id, |
| 316 content::SessionStorageNamespace* session_storage_namespace) { | 318 content::SessionStorageNamespace* session_storage_namespace) { |
| 317 DCHECK_EQ(presentation_web_contents_.get(), contents); | 319 DCHECK_EQ(presentation_web_contents_.get(), contents); |
| 318 // Disallow creating separate WebContentses. The WebContents implementation | 320 // Disallow creating separate WebContentses. The WebContents implementation |
| 319 // uses this to spawn new windows/tabs, which is also not allowed for | 321 // uses this to spawn new windows/tabs, which is also not allowed for |
| 320 // presentation pages. | 322 // presentation pages. |
| 321 return false; | 323 return false; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 470 |
| 469 // Schedule the timer to check again in a second. | 471 // Schedule the timer to check again in a second. |
| 470 capture_poll_timer_.Start( | 472 capture_poll_timer_.Start( |
| 471 FROM_HERE, | 473 FROM_HERE, |
| 472 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), | 474 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), |
| 473 base::Bind(&OffscreenPresentation::DieIfContentCaptureEnded, | 475 base::Bind(&OffscreenPresentation::DieIfContentCaptureEnded, |
| 474 base::Unretained(this))); | 476 base::Unretained(this))); |
| 475 } | 477 } |
| 476 | 478 |
| 477 } // namespace extensions | 479 } // namespace extensions |
| OLD | NEW |