| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 | 153 |
| 154 void OffscreenTab::CanDownload(const GURL& url, | 154 void OffscreenTab::CanDownload(const GURL& url, |
| 155 const std::string& request_method, | 155 const std::string& request_method, |
| 156 const base::Callback<void(bool)>& callback) { | 156 const base::Callback<void(bool)>& callback) { |
| 157 // Offscreen tab pages are not allowed to download files. | 157 // Offscreen tab pages are not allowed to download files. |
| 158 callback.Run(false); | 158 callback.Run(false); |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool OffscreenTab::HandleContextMenu(const content::ContextMenuParams& params) { | 161 bool OffscreenTab::HandleContextMenu(RenderFrameHost* render_frame_host, |
| 162 const content::ContextMenuParams& params) { |
| 162 // Context menus should never be shown. Do nothing, but indicate the context | 163 // Context menus should never be shown. Do nothing, but indicate the context |
| 163 // menu was shown so that default implementation in libcontent does not | 164 // menu was shown so that default implementation in libcontent does not |
| 164 // attempt to do so on its own. | 165 // attempt to do so on its own. |
| 165 return true; | 166 return true; |
| 166 } | 167 } |
| 167 | 168 |
| 168 bool OffscreenTab::PreHandleKeyboardEvent( | 169 bool OffscreenTab::PreHandleKeyboardEvent( |
| 169 WebContents* source, | 170 WebContents* source, |
| 170 const content::NativeWebKeyboardEvent& event, | 171 const content::NativeWebKeyboardEvent& event, |
| 171 bool* is_keyboard_shortcut) { | 172 bool* is_keyboard_shortcut) { |
| (...skipping 179 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 |