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_tab.h" | 5 #include "chrome/browser/extensions/api/tab_capture/offscreen_tab.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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 const content::DropData& data, | 281 const content::DropData& data, |
282 blink::WebDragOperationsMask operations_allowed) { | 282 blink::WebDragOperationsMask operations_allowed) { |
283 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); | 283 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); |
284 // Halt all drag attempts onto the page since there should be no direct user | 284 // Halt all drag attempts onto the page since there should be no direct user |
285 // interaction with it. | 285 // interaction with it. |
286 return false; | 286 return false; |
287 } | 287 } |
288 | 288 |
289 bool OffscreenTab::ShouldCreateWebContents( | 289 bool OffscreenTab::ShouldCreateWebContents( |
290 WebContents* contents, | 290 WebContents* contents, |
291 int route_id, | 291 int32_t route_id, |
292 int main_frame_route_id, | 292 int32_t main_frame_route_id, |
| 293 int32_t main_frame_widget_route_id, |
293 WindowContainerType window_container_type, | 294 WindowContainerType window_container_type, |
294 const std::string& frame_name, | 295 const std::string& frame_name, |
295 const GURL& target_url, | 296 const GURL& target_url, |
296 const std::string& partition_id, | 297 const std::string& partition_id, |
297 content::SessionStorageNamespace* session_storage_namespace) { | 298 content::SessionStorageNamespace* session_storage_namespace) { |
298 DCHECK_EQ(offscreen_tab_web_contents_.get(), contents); | 299 DCHECK_EQ(offscreen_tab_web_contents_.get(), contents); |
299 // Disallow creating separate WebContentses. The WebContents implementation | 300 // Disallow creating separate WebContentses. The WebContents implementation |
300 // uses this to spawn new windows/tabs, which is also not allowed for | 301 // uses this to spawn new windows/tabs, which is also not allowed for |
301 // offscreen tabs. | 302 // offscreen tabs. |
302 return false; | 303 return false; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 445 |
445 // Schedule the timer to check again in a second. | 446 // Schedule the timer to check again in a second. |
446 capture_poll_timer_.Start( | 447 capture_poll_timer_.Start( |
447 FROM_HERE, | 448 FROM_HERE, |
448 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), | 449 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), |
449 base::Bind(&OffscreenTab::DieIfContentCaptureEnded, | 450 base::Bind(&OffscreenTab::DieIfContentCaptureEnded, |
450 base::Unretained(this))); | 451 base::Unretained(this))); |
451 } | 452 } |
452 | 453 |
453 } // namespace extensions | 454 } // namespace extensions |
OLD | NEW |