| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 tab_contents_->web_contents()->GetRenderViewHost()->AllowBindings( | 210 tab_contents_->web_contents()->GetRenderViewHost()->AllowBindings( |
| 211 content::BINDINGS_POLICY_EXTERNAL_HOST); | 211 content::BINDINGS_POLICY_EXTERNAL_HOST); |
| 212 } | 212 } |
| 213 | 213 |
| 214 NavigationController* controller = | 214 NavigationController* controller = |
| 215 &tab_contents_->web_contents()->GetController(); | 215 &tab_contents_->web_contents()->GetController(); |
| 216 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 216 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 217 content::Source<NavigationController>(controller)); | 217 content::Source<NavigationController>(controller)); |
| 218 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, | 218 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, |
| 219 content::Source<NavigationController>(controller)); | 219 content::Source<NavigationController>(controller)); |
| 220 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, | 220 registrar_.Add(this, |
| 221 content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED, |
| 221 content::Source<WebContents>(tab_contents_->web_contents())); | 222 content::Source<WebContents>(tab_contents_->web_contents())); |
| 222 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, | 223 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_DELETED, |
| 223 content::NotificationService::AllSources()); | 224 content::NotificationService::AllSources()); |
| 224 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED, | 225 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED, |
| 225 content::NotificationService::AllSources()); | 226 content::NotificationService::AllSources()); |
| 226 | 227 |
| 227 content::WebContentsObserver::Observe(tab_contents_->web_contents()); | 228 content::WebContentsObserver::Observe(tab_contents_->web_contents()); |
| 228 | 229 |
| 229 // Start loading initial URL | 230 // Start loading initial URL |
| 230 if (!initial_url.is_empty()) { | 231 if (!initial_url.is_empty()) { |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 // 0th entry will be +1). | 900 // 0th entry will be +1). |
| 900 if (InitNavigationInfo(&navigation_info, commit->type, | 901 if (InitNavigationInfo(&navigation_info, commit->type, |
| 901 commit->previous_entry_index - | 902 commit->previous_entry_index - |
| 902 tab_contents_->web_contents()-> | 903 tab_contents_->web_contents()-> |
| 903 GetController().GetLastCommittedEntryIndex())) | 904 GetController().GetLastCommittedEntryIndex())) |
| 904 automation_->Send(new AutomationMsg_DidNavigate(tab_handle_, | 905 automation_->Send(new AutomationMsg_DidNavigate(tab_handle_, |
| 905 navigation_info)); | 906 navigation_info)); |
| 906 } | 907 } |
| 907 break; | 908 break; |
| 908 } | 909 } |
| 909 case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB: { | 910 case content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED: { |
| 910 if (load_requests_via_automation_) { | 911 if (load_requests_via_automation_) { |
| 911 RenderViewHost* rvh = content::Details<RenderViewHost>(details).ptr(); | 912 RenderViewHost* rvh = content::Details<RenderViewHost>(details).ptr(); |
| 912 RegisterRenderViewHostForAutomation(rvh, false); | 913 RegisterRenderViewHostForAutomation(rvh, false); |
| 913 } | 914 } |
| 914 break; | 915 break; |
| 915 } | 916 } |
| 916 case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: { | 917 case content::NOTIFICATION_RENDER_VIEW_HOST_DELETED: { |
| 917 if (load_requests_via_automation_) { | 918 if (load_requests_via_automation_) { |
| 918 RenderViewHost* rvh = content::Source<RenderViewHost>(source).ptr(); | 919 RenderViewHost* rvh = content::Source<RenderViewHost>(source).ptr(); |
| 919 UnregisterRenderViewHost(rvh); | 920 UnregisterRenderViewHost(rvh); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 if (params.disposition == CURRENT_TAB) { | 1248 if (params.disposition == CURRENT_TAB) { |
| 1248 DCHECK(route_all_top_level_navigations_); | 1249 DCHECK(route_all_top_level_navigations_); |
| 1249 forward_params.disposition = NEW_FOREGROUND_TAB; | 1250 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1250 } | 1251 } |
| 1251 WebContents* new_contents = | 1252 WebContents* new_contents = |
| 1252 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); | 1253 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); |
| 1253 // support only one navigation for a dummy tab before it is killed. | 1254 // support only one navigation for a dummy tab before it is killed. |
| 1254 ::DestroyWindow(GetNativeView()); | 1255 ::DestroyWindow(GetNativeView()); |
| 1255 return new_contents; | 1256 return new_contents; |
| 1256 } | 1257 } |
| OLD | NEW |