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/views/external_tab_container_win.h" | 5 #include "chrome/browser/ui/views/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 Loading... |
186 | 186 |
187 // TODO(jcampan): limit focus traversal to contents. | 187 // TODO(jcampan): limit focus traversal to contents. |
188 | 188 |
189 prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this)); | 189 prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this)); |
190 | 190 |
191 if (existing_contents) { | 191 if (existing_contents) { |
192 tab_contents_.reset(existing_contents); | 192 tab_contents_.reset(existing_contents); |
193 tab_contents_->web_contents()->GetController().SetBrowserContext(profile); | 193 tab_contents_->web_contents()->GetController().SetBrowserContext(profile); |
194 } else { | 194 } else { |
195 WebContents* new_contents = WebContents::Create( | 195 WebContents* new_contents = WebContents::Create( |
196 profile, NULL, MSG_ROUTING_NONE, NULL, NULL); | 196 profile, NULL, MSG_ROUTING_NONE, NULL); |
197 tab_contents_.reset(new TabContents(new_contents)); | 197 tab_contents_.reset(new TabContents(new_contents)); |
198 } | 198 } |
199 | 199 |
200 if (!infobars_enabled) | 200 if (!infobars_enabled) |
201 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false); | 201 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false); |
202 | 202 |
203 tab_contents_->web_contents()->SetDelegate(this); | 203 tab_contents_->web_contents()->SetDelegate(this); |
204 | 204 |
205 tab_contents_->web_contents()-> | 205 tab_contents_->web_contents()-> |
206 GetMutableRendererPrefs()->browser_handles_non_local_top_level_requests = | 206 GetMutableRendererPrefs()->browser_handles_non_local_top_level_requests = |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 if (params.disposition == CURRENT_TAB) { | 1254 if (params.disposition == CURRENT_TAB) { |
1255 DCHECK(route_all_top_level_navigations_); | 1255 DCHECK(route_all_top_level_navigations_); |
1256 forward_params.disposition = NEW_FOREGROUND_TAB; | 1256 forward_params.disposition = NEW_FOREGROUND_TAB; |
1257 } | 1257 } |
1258 WebContents* new_contents = | 1258 WebContents* new_contents = |
1259 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); | 1259 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); |
1260 // support only one navigation for a dummy tab before it is killed. | 1260 // support only one navigation for a dummy tab before it is killed. |
1261 ::DestroyWindow(GetNativeView()); | 1261 ::DestroyWindow(GetNativeView()); |
1262 return new_contents; | 1262 return new_contents; |
1263 } | 1263 } |
OLD | NEW |