OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // TODO(jcampan): limit focus traversal to contents. | 99 // TODO(jcampan): limit focus traversal to contents. |
100 | 100 |
101 // We don't ever remove the prop because the lifetime of this object | 101 // We don't ever remove the prop because the lifetime of this object |
102 // is the same as the lifetime of the window | 102 // is the same as the lifetime of the window |
103 SetProp(GetNativeView(), kWindowObjectKey, this); | 103 SetProp(GetNativeView(), kWindowObjectKey, this); |
104 | 104 |
105 if (existing_contents) { | 105 if (existing_contents) { |
106 tab_contents_ = existing_contents; | 106 tab_contents_ = existing_contents; |
107 tab_contents_->controller().set_profile(profile); | 107 tab_contents_->controller().set_profile(profile); |
108 } else { | 108 } else { |
109 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 109 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, |
| 110 NULL, NULL); |
110 } | 111 } |
111 | 112 |
112 tab_contents_->set_delegate(this); | 113 tab_contents_->set_delegate(this); |
113 | 114 |
114 tab_contents_->GetMutableRendererPrefs()->browser_handles_top_level_requests = | 115 tab_contents_->GetMutableRendererPrefs()->browser_handles_top_level_requests = |
115 handle_top_level_requests; | 116 handle_top_level_requests; |
116 | 117 |
117 if (!existing_contents) { | 118 if (!existing_contents) { |
118 tab_contents_->render_view_host()->AllowBindings( | 119 tab_contents_->render_view_host()->AllowBindings( |
119 BindingsPolicy::EXTERNAL_HOST); | 120 BindingsPolicy::EXTERNAL_HOST); |
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 external_tab_view_->SetLayoutManager(layout); | 985 external_tab_view_->SetLayoutManager(layout); |
985 | 986 |
986 layout->StartRow(0, 0); | 987 layout->StartRow(0, 0); |
987 layout->AddView(info_bar_container); | 988 layout->AddView(info_bar_container); |
988 layout->StartRow(1, 0); | 989 layout->StartRow(1, 0); |
989 layout->AddView(tab_contents_container_); | 990 layout->AddView(tab_contents_container_); |
990 SetContentsView(external_tab_view_); | 991 SetContentsView(external_tab_view_); |
991 // Note that SetTabContents must be called after AddChildView is called | 992 // Note that SetTabContents must be called after AddChildView is called |
992 tab_contents_container_->ChangeTabContents(tab_contents_); | 993 tab_contents_container_->ChangeTabContents(tab_contents_); |
993 } | 994 } |
OLD | NEW |