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

Side by Side Diff: chrome/browser/external_tab/external_tab_container_win.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/external_tab/external_tab_container_win.h" 5 #include "chrome/browser/external_tab/external_tab_container_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 profile, NULL, MSG_ROUTING_NONE, NULL, NULL); 186 profile, NULL, MSG_ROUTING_NONE, NULL, NULL);
187 tab_contents_.reset(new TabContentsWrapper(new_contents)); 187 tab_contents_.reset(new TabContentsWrapper(new_contents));
188 } 188 }
189 189
190 if (!infobars_enabled) 190 if (!infobars_enabled)
191 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false); 191 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false);
192 192
193 tab_contents_->web_contents()->SetDelegate(this); 193 tab_contents_->web_contents()->SetDelegate(this);
194 194
195 tab_contents_->web_contents()-> 195 tab_contents_->web_contents()->
196 GetMutableRendererPrefs()->browser_handles_top_level_requests = 196 GetMutableRendererPrefs()->browser_handles_non_local_top_level_requests =
197 handle_top_level_requests; 197 handle_top_level_requests;
198 198
199 if (!existing_contents) { 199 if (!existing_contents) {
200 tab_contents_->web_contents()->GetRenderViewHost()->AllowBindings( 200 tab_contents_->web_contents()->GetRenderViewHost()->AllowBindings(
201 content::BINDINGS_POLICY_EXTERNAL_HOST); 201 content::BINDINGS_POLICY_EXTERNAL_HOST);
202 } 202 }
203 203
204 NavigationController* controller = 204 NavigationController* controller =
205 &tab_contents_->web_contents()->GetController(); 205 &tab_contents_->web_contents()->GetController();
206 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, 206 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 if (params.disposition == CURRENT_TAB) { 1201 if (params.disposition == CURRENT_TAB) {
1202 DCHECK(route_all_top_level_navigations_); 1202 DCHECK(route_all_top_level_navigations_);
1203 forward_params.disposition = NEW_FOREGROUND_TAB; 1203 forward_params.disposition = NEW_FOREGROUND_TAB;
1204 } 1204 }
1205 WebContents* new_contents = 1205 WebContents* new_contents =
1206 ExternalTabContainer::OpenURLFromTab(source, forward_params); 1206 ExternalTabContainer::OpenURLFromTab(source, forward_params);
1207 // support only one navigation for a dummy tab before it is killed. 1207 // support only one navigation for a dummy tab before it is killed.
1208 ::DestroyWindow(GetNativeView()); 1208 ::DestroyWindow(GetNativeView());
1209 return new_contents; 1209 return new_contents;
1210 } 1210 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/platform_app_browsertest.cc ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698