OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/offscreen_tabs/offscreen_tabs_api.h" | 5 #include "chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 OffscreenTab::OffscreenTab() : parent_tab_(NULL) {} | 220 OffscreenTab::OffscreenTab() : parent_tab_(NULL) {} |
221 OffscreenTab::~OffscreenTab() {} | 221 OffscreenTab::~OffscreenTab() {} |
222 | 222 |
223 void OffscreenTab::Init(const GURL& url, | 223 void OffscreenTab::Init(const GURL& url, |
224 const int width, | 224 const int width, |
225 const int height, | 225 const int height, |
226 Profile* profile, | 226 Profile* profile, |
227 ParentTab* parent_tab) { | 227 ParentTab* parent_tab) { |
228 // Create the offscreen tab. | 228 // Create the offscreen tab. |
229 WebContents* web_contents = WebContents::Create( | 229 WebContents* web_contents = WebContents::Create( |
230 profile, NULL, MSG_ROUTING_NONE, NULL, NULL); | 230 profile, NULL, MSG_ROUTING_NONE, NULL); |
231 tab_contents_.reset(new TabContents(web_contents)); | 231 tab_contents_.reset(new TabContents(web_contents)); |
232 | 232 |
233 // Setting the size starts the renderer. | 233 // Setting the size starts the renderer. |
234 SetSize(width, height); | 234 SetSize(width, height); |
235 NavigateToURL(url); | 235 NavigateToURL(url); |
236 | 236 |
237 parent_tab_ = parent_tab; | 237 parent_tab_ = parent_tab; |
238 | 238 |
239 // Register for tab notifications. | 239 // Register for tab notifications. |
240 registrar_.Add( | 240 registrar_.Add( |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // async case (when a "javascript": URL is sent to a tab). | 830 // async case (when a "javascript": URL is sent to a tab). |
831 if (!is_async) | 831 if (!is_async) |
832 SendResponse(true); | 832 SendResponse(true); |
833 | 833 |
834 return true; | 834 return true; |
835 } | 835 } |
836 | 836 |
837 void UpdateOffscreenTabFunction::PopulateResult() { | 837 void UpdateOffscreenTabFunction::PopulateResult() { |
838 // There's no result associated with this callback. | 838 // There's no result associated with this callback. |
839 } | 839 } |
OLD | NEW |