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 "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 void OffscreenTab::CloseContents(WebContents* source) { | 124 void OffscreenTab::CloseContents(WebContents* source) { |
125 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); | 125 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); |
126 // Javascript in the page called window.close(). | 126 // Javascript in the page called window.close(). |
127 DVLOG(1) << "OffscreenTab will die at renderer's request for start_url=" | 127 DVLOG(1) << "OffscreenTab will die at renderer's request for start_url=" |
128 << start_url_.spec(); | 128 << start_url_.spec(); |
129 owner_->DestroyTab(this); | 129 owner_->DestroyTab(this); |
130 // |this| is no longer valid. | 130 // |this| is no longer valid. |
131 } | 131 } |
132 | 132 |
133 bool OffscreenTab::ShouldSuppressDialogs(WebContents* source) { | 133 bool OffscreenTab::ShouldSuppressDialogs(WebContents* source, |
| 134 bool before_unload) { |
134 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); | 135 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); |
135 // Suppress all because there is no possible direct user interaction with | 136 // Suppress all because there is no possible direct user interaction with |
136 // dialogs. | 137 // dialogs. |
137 return true; | 138 return true; |
138 } | 139 } |
139 | 140 |
140 bool OffscreenTab::ShouldFocusLocationBarByDefault(WebContents* source) { | 141 bool OffscreenTab::ShouldFocusLocationBarByDefault(WebContents* source) { |
141 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); | 142 DCHECK_EQ(offscreen_tab_web_contents_.get(), source); |
142 // Indicate the location bar should be focused instead of the page, even | 143 // Indicate the location bar should be focused instead of the page, even |
143 // though there is no location bar. This will prevent the page from | 144 // though there is no location bar. This will prevent the page from |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 352 |
352 // Schedule the timer to check again in a second. | 353 // Schedule the timer to check again in a second. |
353 capture_poll_timer_.Start( | 354 capture_poll_timer_.Start( |
354 FROM_HERE, | 355 FROM_HERE, |
355 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), | 356 base::TimeDelta::FromSeconds(kPollIntervalInSeconds), |
356 base::Bind(&OffscreenTab::DieIfContentCaptureEnded, | 357 base::Bind(&OffscreenTab::DieIfContentCaptureEnded, |
357 base::Unretained(this))); | 358 base::Unretained(this))); |
358 } | 359 } |
359 | 360 |
360 } // namespace extensions | 361 } // namespace extensions |
OLD | NEW |