| 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/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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 401 } |
| 402 break; | 402 break; |
| 403 default: | 403 default: |
| 404 NOTREACHED(); | 404 NOTREACHED(); |
| 405 break; | 405 break; |
| 406 } | 406 } |
| 407 | 407 |
| 408 return NULL; | 408 return NULL; |
| 409 } | 409 } |
| 410 | 410 |
| 411 virtual bool ExternalTabContainer::ShouldIgnoreNavigation( |
| 412 WebContents* source, |
| 413 const GURL& url, |
| 414 const content::Referrer& referrer, |
| 415 WindowOpenDisposition disposition, |
| 416 bool is_content_intiated, |
| 417 content::PageTransition transition_type) { |
| 418 // This will make every navigation browser-initiated. |
| 419 // TODO: Investigate modifying ExternalTabContainer to work without canceling |
| 420 // and re-issuing every navigation. |
| 421 |
| 422 if (is_content_intiated) |
| 423 source->GetController().LoadURL(url, params.referrer, transition, |
| 424 std::string()); |
| 425 return true; |
| 426 } |
| 427 |
| 411 void ExternalTabContainer::NavigationStateChanged(const WebContents* source, | 428 void ExternalTabContainer::NavigationStateChanged(const WebContents* source, |
| 412 unsigned changed_flags) { | 429 unsigned changed_flags) { |
| 413 if (automation_) { | 430 if (automation_) { |
| 414 NavigationInfo nav_info; | 431 NavigationInfo nav_info; |
| 415 if (InitNavigationInfo(&nav_info, content::NAVIGATION_TYPE_NAV_IGNORE, 0)) | 432 if (InitNavigationInfo(&nav_info, content::NAVIGATION_TYPE_NAV_IGNORE, 0)) |
| 416 automation_->Send(new AutomationMsg_NavigationStateChanged( | 433 automation_->Send(new AutomationMsg_NavigationStateChanged( |
| 417 tab_handle_, changed_flags, nav_info)); | 434 tab_handle_, changed_flags, nav_info)); |
| 418 } | 435 } |
| 419 } | 436 } |
| 420 | 437 |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 if (params.disposition == CURRENT_TAB) { | 1226 if (params.disposition == CURRENT_TAB) { |
| 1210 DCHECK(route_all_top_level_navigations_); | 1227 DCHECK(route_all_top_level_navigations_); |
| 1211 forward_params.disposition = NEW_FOREGROUND_TAB; | 1228 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1212 } | 1229 } |
| 1213 WebContents* new_contents = | 1230 WebContents* new_contents = |
| 1214 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1231 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
| 1215 // support only one navigation for a dummy tab before it is killed. | 1232 // support only one navigation for a dummy tab before it is killed. |
| 1216 ::DestroyWindow(GetNativeView()); | 1233 ::DestroyWindow(GetNativeView()); |
| 1217 return new_contents; | 1234 return new_contents; |
| 1218 } | 1235 } |
| OLD | NEW |