Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 10387074: Only disallow top-level navigations in platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 extension_(extension), 97 extension_(extension),
98 ALLOW_THIS_IN_INITIALIZER_LIST( 98 ALLOW_THIS_IN_INITIALIZER_LIST(
99 extension_function_dispatcher_(profile, this)) { 99 extension_function_dispatcher_(profile, this)) {
100 web_contents_ = WebContents::Create( 100 web_contents_ = WebContents::Create(
101 profile, SiteInstance::CreateForURL(profile, url), MSG_ROUTING_NONE, NULL, 101 profile, SiteInstance::CreateForURL(profile, url), MSG_ROUTING_NONE, NULL,
102 NULL); 102 NULL);
103 contents_wrapper_.reset(new TabContentsWrapper(web_contents_)); 103 contents_wrapper_.reset(new TabContentsWrapper(web_contents_));
104 content::WebContentsObserver::Observe(web_contents_); 104 content::WebContentsObserver::Observe(web_contents_);
105 web_contents_->SetDelegate(this); 105 web_contents_->SetDelegate(this);
106 web_contents_->SetViewType(chrome::VIEW_TYPE_APP_SHELL); 106 web_contents_->SetViewType(chrome::VIEW_TYPE_APP_SHELL);
107 web_contents_->GetMutableRendererPrefs()->browser_handles_all_requests = 107 web_contents_->GetMutableRendererPrefs()->
108 true; 108 browser_handles_all_top_level_requests = true;
109 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); 109 web_contents_->GetRenderViewHost()->SyncRendererPrefs();
110 110
111 web_contents_->GetController().LoadURL( 111 web_contents_->GetController().LoadURL(
112 url, content::Referrer(), content::PAGE_TRANSITION_LINK, 112 url, content::Referrer(), content::PAGE_TRANSITION_LINK,
113 std::string()); 113 std::string());
114 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 114 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
115 content::Source<Profile>(profile_)); 115 content::Source<Profile>(profile_));
116 // Close when the browser is exiting. 116 // Close when the browser is exiting.
117 // TODO(mihaip): we probably don't want this in the long run (when platform 117 // TODO(mihaip): we probably don't want this in the long run (when platform
118 // apps are no longer tied to the browser process). 118 // apps are no longer tied to the browser process).
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 ExtensionWindowController* ShellWindow::GetExtensionWindowController() const { 198 ExtensionWindowController* ShellWindow::GetExtensionWindowController() const {
199 return extension_window_controller_.get(); 199 return extension_window_controller_.get();
200 } 200 }
201 201
202 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { 202 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) {
203 extension_function_dispatcher_.Dispatch(params, 203 extension_function_dispatcher_.Dispatch(params,
204 web_contents_->GetRenderViewHost()); 204 web_contents_->GetRenderViewHost());
205 } 205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698