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/external_tab_container_win.h" | 5 #include "chrome/browser/external_tab_container_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 NOTREACHED(); | 178 NOTREACHED(); |
179 return false; | 179 return false; |
180 } | 180 } |
181 | 181 |
182 // TODO(jcampan): limit focus traversal to contents. | 182 // TODO(jcampan): limit focus traversal to contents. |
183 | 183 |
184 prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this)); | 184 prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this)); |
185 | 185 |
186 if (existing_contents) { | 186 if (existing_contents) { |
187 tab_contents_.reset(existing_contents); | 187 tab_contents_.reset(existing_contents); |
188 tab_contents_->controller().set_profile(profile); | 188 tab_contents_->controller().set_browser_context(profile); |
189 } else { | 189 } else { |
190 TabContents* new_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, | 190 TabContents* new_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, |
191 NULL, NULL); | 191 NULL, NULL); |
192 tab_contents_.reset(new TabContentsWrapper(new_contents)); | 192 tab_contents_.reset(new TabContentsWrapper(new_contents)); |
193 } | 193 } |
194 | 194 |
195 if (!infobars_enabled) | 195 if (!infobars_enabled) |
196 tab_contents_->set_infobars_enabled(false); | 196 tab_contents_->set_infobars_enabled(false); |
197 | 197 |
198 tab_contents_->tab_contents()->set_delegate(this); | 198 tab_contents_->tab_contents()->set_delegate(this); |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 DCHECK(route_all_top_level_navigations_); | 1153 DCHECK(route_all_top_level_navigations_); |
1154 disposition = NEW_FOREGROUND_TAB; | 1154 disposition = NEW_FOREGROUND_TAB; |
1155 } | 1155 } |
1156 TabContents* new_contents = | 1156 TabContents* new_contents = |
1157 ExternalTabContainer::OpenURLFromTab( | 1157 ExternalTabContainer::OpenURLFromTab( |
1158 source, url, referrer, disposition, transition); | 1158 source, url, referrer, disposition, transition); |
1159 // support only one navigation for a dummy tab before it is killed. | 1159 // support only one navigation for a dummy tab before it is killed. |
1160 ::DestroyWindow(GetNativeView()); | 1160 ::DestroyWindow(GetNativeView()); |
1161 return new_contents; | 1161 return new_contents; |
1162 } | 1162 } |
OLD | NEW |