| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 : extension_(extension), | 128 : extension_(extension), |
| 129 profile_(site_instance->browsing_instance()->profile()), | 129 profile_(site_instance->browsing_instance()->profile()), |
| 130 did_stop_loading_(false), | 130 did_stop_loading_(false), |
| 131 document_element_available_(false), | 131 document_element_available_(false), |
| 132 url_(url), | 132 url_(url), |
| 133 extension_host_type_(host_type), | 133 extension_host_type_(host_type), |
| 134 associated_tab_contents_(NULL) { | 134 associated_tab_contents_(NULL) { |
| 135 render_view_host_ = new RenderViewHost(site_instance, this, MSG_ROUTING_NONE, | 135 render_view_host_ = new RenderViewHost(site_instance, this, MSG_ROUTING_NONE, |
| 136 NULL); | 136 NULL); |
| 137 render_view_host_->set_is_extension_process(true); | 137 render_view_host_->set_is_extension_process(true); |
| 138 if (extension->is_app()) |
| 139 render_view_host_->set_installed_app(extension); |
| 138 render_view_host_->AllowBindings(BindingsPolicy::EXTENSION); | 140 render_view_host_->AllowBindings(BindingsPolicy::EXTENSION); |
| 139 if (enable_dom_automation_) | 141 if (enable_dom_automation_) |
| 140 render_view_host_->AllowBindings(BindingsPolicy::DOM_AUTOMATION); | 142 render_view_host_->AllowBindings(BindingsPolicy::DOM_AUTOMATION); |
| 141 | 143 |
| 142 // Listen for when the render process' handle is available so we can add it | 144 // Listen for when the render process' handle is available so we can add it |
| 143 // to the task manager then. | 145 // to the task manager then. |
| 144 registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED, | 146 registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED, |
| 145 Source<RenderProcessHost>(render_process_host())); | 147 Source<RenderProcessHost>(render_process_host())); |
| 146 // Listen for when an extension is unloaded from the same profile, as it may | 148 // Listen for when an extension is unloaded from the same profile, as it may |
| 147 // be the same extension that this points to. | 149 // be the same extension that this points to. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 } | 815 } |
| 814 return window_id; | 816 return window_id; |
| 815 } | 817 } |
| 816 | 818 |
| 817 void ExtensionHost::OnRunFileChooser( | 819 void ExtensionHost::OnRunFileChooser( |
| 818 const ViewHostMsg_RunFileChooser_Params& params) { | 820 const ViewHostMsg_RunFileChooser_Params& params) { |
| 819 if (file_select_helper_.get() == NULL) | 821 if (file_select_helper_.get() == NULL) |
| 820 file_select_helper_.reset(new FileSelectHelper(profile())); | 822 file_select_helper_.reset(new FileSelectHelper(profile())); |
| 821 file_select_helper_->RunFileChooser(render_view_host_, params); | 823 file_select_helper_->RunFileChooser(render_view_host_, params); |
| 822 } | 824 } |
| OLD | NEW |