| 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/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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 site_instance->GetBrowserContext())), | 133 site_instance->GetBrowserContext())), |
| 134 render_view_host_(NULL), | 134 render_view_host_(NULL), |
| 135 did_stop_loading_(false), | 135 did_stop_loading_(false), |
| 136 document_element_available_(false), | 136 document_element_available_(false), |
| 137 initial_url_(url), | 137 initial_url_(url), |
| 138 ALLOW_THIS_IN_INITIALIZER_LIST( | 138 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 139 extension_function_dispatcher_(profile_, this)), | 139 extension_function_dispatcher_(profile_, this)), |
| 140 extension_host_type_(host_type), | 140 extension_host_type_(host_type), |
| 141 associated_web_contents_(NULL) { | 141 associated_web_contents_(NULL) { |
| 142 host_contents_.reset(WebContents::Create( | 142 host_contents_.reset(WebContents::Create( |
| 143 profile_, site_instance, MSG_ROUTING_NONE, NULL, NULL)); | 143 profile_, site_instance, MSG_ROUTING_NONE, NULL)); |
| 144 content::WebContentsObserver::Observe(host_contents_.get()); | 144 content::WebContentsObserver::Observe(host_contents_.get()); |
| 145 host_contents_->SetDelegate(this); | 145 host_contents_->SetDelegate(this); |
| 146 chrome::SetViewType(host_contents_.get(), host_type); | 146 chrome::SetViewType(host_contents_.get(), host_type); |
| 147 | 147 |
| 148 prefs_tab_helper_.reset(new PrefsTabHelper(host_contents())); | 148 prefs_tab_helper_.reset(new PrefsTabHelper(host_contents())); |
| 149 | 149 |
| 150 render_view_host_ = host_contents_->GetRenderViewHost(); | 150 render_view_host_ = host_contents_->GetRenderViewHost(); |
| 151 | 151 |
| 152 // Listen for when an extension is unloaded from the same profile, as it may | 152 // Listen for when an extension is unloaded from the same profile, as it may |
| 153 // be the same extension that this points to. | 153 // be the same extension that this points to. |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 } | 597 } |
| 598 | 598 |
| 599 void ExtensionHost::RenderViewReady() { | 599 void ExtensionHost::RenderViewReady() { |
| 600 content::NotificationService::current()->Notify( | 600 content::NotificationService::current()->Notify( |
| 601 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 601 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
| 602 content::Source<Profile>(profile_), | 602 content::Source<Profile>(profile_), |
| 603 content::Details<ExtensionHost>(this)); | 603 content::Details<ExtensionHost>(this)); |
| 604 } | 604 } |
| 605 | 605 |
| 606 } // namespace extensions | 606 } // namespace extensions |
| OLD | NEW |