| 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 return notify_disconnection() && | 566 return notify_disconnection() && |
| 567 !showing_interstitial_page() && | 567 !showing_interstitial_page() && |
| 568 !render_view_host()->SuddenTerminationAllowed(); | 568 !render_view_host()->SuddenTerminationAllowed(); |
| 569 } | 569 } |
| 570 | 570 |
| 571 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 571 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
| 572 TabContents* TabContents::OpenURL(const GURL& url, | 572 TabContents* TabContents::OpenURL(const GURL& url, |
| 573 const GURL& referrer, | 573 const GURL& referrer, |
| 574 WindowOpenDisposition disposition, | 574 WindowOpenDisposition disposition, |
| 575 content::PageTransition transition) { | 575 content::PageTransition transition) { |
| 576 // For specifying a referrer, use the version of OpenURL taking OpenURLParams. |
| 577 DCHECK(referrer.is_empty()); |
| 576 return OpenURL(OpenURLParams(url, referrer, disposition, transition, | 578 return OpenURL(OpenURLParams(url, referrer, disposition, transition, |
| 577 false)); | 579 false)); |
| 578 } | 580 } |
| 579 | 581 |
| 580 TabContents* TabContents::OpenURL(const OpenURLParams& params) { | 582 TabContents* TabContents::OpenURL(const OpenURLParams& params) { |
| 581 if (delegate_) { | 583 if (delegate_) { |
| 582 TabContents* new_contents = delegate_->OpenURLFromTab(this, params); | 584 TabContents* new_contents = delegate_->OpenURLFromTab(this, params); |
| 583 // Notify observers. | 585 // Notify observers. |
| 584 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 586 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
| 585 DidOpenURL(params.url, params.referrer, | 587 DidOpenURL(params.url, params.referrer, |
| (...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2056 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2058 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2057 // Can be NULL during tests. | 2059 // Can be NULL during tests. |
| 2058 if (rwh_view) | 2060 if (rwh_view) |
| 2059 rwh_view->SetSize(view()->GetContainerSize()); | 2061 rwh_view->SetSize(view()->GetContainerSize()); |
| 2060 } | 2062 } |
| 2061 | 2063 |
| 2062 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { | 2064 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { |
| 2063 return render_view_host() ? | 2065 return render_view_host() ? |
| 2064 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; | 2066 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; |
| 2065 } | 2067 } |
| OLD | NEW |