OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 void ExtensionHost::LoadInitialURL() { | 238 void ExtensionHost::LoadInitialURL() { |
239 if (!is_background_page() && | 239 if (!is_background_page() && |
240 !profile_->GetExtensionService()->IsBackgroundPageReady(extension_)) { | 240 !profile_->GetExtensionService()->IsBackgroundPageReady(extension_)) { |
241 // Make sure the background page loads before any others. | 241 // Make sure the background page loads before any others. |
242 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 242 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
243 content::Source<Extension>(extension_)); | 243 content::Source<Extension>(extension_)); |
244 return; | 244 return; |
245 } | 245 } |
246 | 246 |
247 host_contents_->controller().LoadURL( | 247 host_contents_->controller().LoadURL( |
248 initial_url_, GURL(), content::PAGE_TRANSITION_LINK, std::string()); | 248 initial_url_, content::Referrer(), content::PAGE_TRANSITION_LINK, |
| 249 std::string()); |
249 } | 250 } |
250 | 251 |
251 void ExtensionHost::Observe(int type, | 252 void ExtensionHost::Observe(int type, |
252 const content::NotificationSource& source, | 253 const content::NotificationSource& source, |
253 const content::NotificationDetails& details) { | 254 const content::NotificationDetails& details) { |
254 switch (type) { | 255 switch (type) { |
255 case chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY: | 256 case chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY: |
256 DCHECK(profile_->GetExtensionService()-> | 257 DCHECK(profile_->GetExtensionService()-> |
257 IsBackgroundPageReady(extension_)); | 258 IsBackgroundPageReady(extension_)); |
258 LoadInitialURL(); | 259 LoadInitialURL(); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); | 517 browser->AddTabContents(contents, disposition, initial_pos, user_gesture); |
517 } | 518 } |
518 | 519 |
519 | 520 |
520 void ExtensionHost::RenderViewReady() { | 521 void ExtensionHost::RenderViewReady() { |
521 content::NotificationService::current()->Notify( | 522 content::NotificationService::current()->Notify( |
522 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 523 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
523 content::Source<Profile>(profile_), | 524 content::Source<Profile>(profile_), |
524 content::Details<ExtensionHost>(this)); | 525 content::Details<ExtensionHost>(this)); |
525 } | 526 } |
OLD | NEW |