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 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 24 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
28 #include "chrome/common/chrome_view_type.h" | 28 #include "chrome/common/chrome_view_type.h" |
29 #include "chrome/common/extensions/extension.h" | 29 #include "chrome/common/extensions/extension.h" |
30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
31 #include "chrome/common/extensions/extension_messages.h" | 31 #include "chrome/common/extensions/extension_messages.h" |
32 #include "chrome/common/render_messages.h" | 32 #include "chrome/common/render_messages.h" |
33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
34 #include "content/browser/browsing_instance.h" | |
35 #include "content/browser/renderer_host/render_view_host.h" | 34 #include "content/browser/renderer_host/render_view_host.h" |
36 #include "content/browser/site_instance.h" | 35 #include "content/browser/site_instance.h" |
37 #include "content/browser/tab_contents/tab_contents_view.h" | 36 #include "content/browser/tab_contents/tab_contents_view.h" |
38 #include "content/public/browser/content_browser_client.h" | 37 #include "content/public/browser/content_browser_client.h" |
39 #include "content/public/browser/native_web_keyboard_event.h" | 38 #include "content/public/browser/native_web_keyboard_event.h" |
40 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
41 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
42 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
43 #include "grit/browser_resources.h" | 42 #include "grit/browser_resources.h" |
44 #include "grit/chromium_strings.h" | 43 #include "grit/chromium_strings.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 //////////////// | 115 //////////////// |
117 // ExtensionHost | 116 // ExtensionHost |
118 | 117 |
119 ExtensionHost::ExtensionHost(const Extension* extension, | 118 ExtensionHost::ExtensionHost(const Extension* extension, |
120 SiteInstance* site_instance, | 119 SiteInstance* site_instance, |
121 const GURL& url, | 120 const GURL& url, |
122 content::ViewType host_type) | 121 content::ViewType host_type) |
123 : extension_(extension), | 122 : extension_(extension), |
124 extension_id_(extension->id()), | 123 extension_id_(extension->id()), |
125 profile_(Profile::FromBrowserContext( | 124 profile_(Profile::FromBrowserContext( |
126 site_instance->browsing_instance()->browser_context())), | 125 site_instance->GetBrowserContext())), |
127 render_view_host_(NULL), | 126 render_view_host_(NULL), |
128 did_stop_loading_(false), | 127 did_stop_loading_(false), |
129 document_element_available_(false), | 128 document_element_available_(false), |
130 initial_url_(url), | 129 initial_url_(url), |
131 ALLOW_THIS_IN_INITIALIZER_LIST( | 130 ALLOW_THIS_IN_INITIALIZER_LIST( |
132 extension_function_dispatcher_(profile_, this)), | 131 extension_function_dispatcher_(profile_, this)), |
133 extension_host_type_(host_type), | 132 extension_host_type_(host_type), |
134 associated_web_contents_(NULL) { | 133 associated_web_contents_(NULL) { |
135 host_contents_.reset(WebContents::Create( | 134 host_contents_.reset(WebContents::Create( |
136 profile_, site_instance, MSG_ROUTING_NONE, NULL, NULL)); | 135 profile_, site_instance, MSG_ROUTING_NONE, NULL, NULL)); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 browser::Navigate(¶ms); | 552 browser::Navigate(¶ms); |
554 } | 553 } |
555 | 554 |
556 | 555 |
557 void ExtensionHost::RenderViewReady() { | 556 void ExtensionHost::RenderViewReady() { |
558 content::NotificationService::current()->Notify( | 557 content::NotificationService::current()->Notify( |
559 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 558 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
560 content::Source<Profile>(profile_), | 559 content::Source<Profile>(profile_), |
561 content::Details<ExtensionHost>(this)); | 560 content::Details<ExtensionHost>(this)); |
562 } | 561 } |
OLD | NEW |