| 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/ui/extensions/shell_window.h" | 5 #include "chrome/browser/ui/extensions/shell_window.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_process_manager.h" | 7 #include "chrome/browser/extensions/extension_process_manager.h" |
| 8 #include "chrome/browser/extensions/extension_tabs_module_constants.h" | 8 #include "chrome/browser/extensions/extension_tabs_module_constants.h" |
| 9 #include "chrome/browser/extensions/extension_window_controller.h" | 9 #include "chrome/browser/extensions/extension_window_controller.h" |
| 10 #include "chrome/browser/extensions/shell_window_registry.h" | 10 #include "chrome/browser/extensions/shell_window_registry.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 : profile_(profile), | 104 : profile_(profile), |
| 105 extension_(extension), | 105 extension_(extension), |
| 106 ALLOW_THIS_IN_INITIALIZER_LIST( | 106 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 107 extension_function_dispatcher_(profile, this)) { | 107 extension_function_dispatcher_(profile, this)) { |
| 108 web_contents_ = WebContents::Create( | 108 web_contents_ = WebContents::Create( |
| 109 profile, SiteInstance::CreateForURL(profile, url), MSG_ROUTING_NONE, NULL, | 109 profile, SiteInstance::CreateForURL(profile, url), MSG_ROUTING_NONE, NULL, |
| 110 NULL); | 110 NULL); |
| 111 contents_wrapper_.reset(new TabContentsWrapper(web_contents_)); | 111 contents_wrapper_.reset(new TabContentsWrapper(web_contents_)); |
| 112 content::WebContentsObserver::Observe(web_contents_); | 112 content::WebContentsObserver::Observe(web_contents_); |
| 113 web_contents_->SetDelegate(this); | 113 web_contents_->SetDelegate(this); |
| 114 web_contents_->SetViewType(chrome::VIEW_TYPE_APP_SHELL); | 114 chrome::SetViewType(web_contents_, chrome::VIEW_TYPE_APP_SHELL); |
| 115 web_contents_->GetMutableRendererPrefs()-> | 115 web_contents_->GetMutableRendererPrefs()-> |
| 116 browser_handles_all_top_level_requests = true; | 116 browser_handles_all_top_level_requests = true; |
| 117 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); | 117 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); |
| 118 | 118 |
| 119 web_contents_->GetController().LoadURL( | 119 web_contents_->GetController().LoadURL( |
| 120 url, content::Referrer(), content::PAGE_TRANSITION_LINK, | 120 url, content::Referrer(), content::PAGE_TRANSITION_LINK, |
| 121 std::string()); | 121 std::string()); |
| 122 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 122 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 123 content::Source<Profile>(profile_)); | 123 content::Source<Profile>(profile_)); |
| 124 // Close when the browser is exiting. | 124 // Close when the browser is exiting. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 ExtensionWindowController* ShellWindow::GetExtensionWindowController() const { | 206 ExtensionWindowController* ShellWindow::GetExtensionWindowController() const { |
| 207 return extension_window_controller_.get(); | 207 return extension_window_controller_.get(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { | 210 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { |
| 211 extension_function_dispatcher_.Dispatch(params, | 211 extension_function_dispatcher_.Dispatch(params, |
| 212 web_contents_->GetRenderViewHost()); | 212 web_contents_->GetRenderViewHost()); |
| 213 } | 213 } |
| OLD | NEW |