Chromium Code Reviews| 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 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 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2305 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2305 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2306 DidOpenRequestedURL(new_contents, | 2306 DidOpenRequestedURL(new_contents, |
| 2307 url, | 2307 url, |
| 2308 referrer, | 2308 referrer, |
| 2309 disposition, | 2309 disposition, |
| 2310 transition_type, | 2310 transition_type, |
| 2311 source_frame_id)); | 2311 source_frame_id)); |
| 2312 } | 2312 } |
| 2313 } | 2313 } |
| 2314 | 2314 |
| 2315 bool TabContents::ShouldIgnoreNavigation( | |
| 2316 const GURL& url, | |
| 2317 const content::Referrer& referrer, | |
| 2318 WindowOpenDisposition disposition, | |
| 2319 int64 source_frame_id, | |
| 2320 bool is_content_initiated) { | |
| 2321 if (!delegate_) | |
| 2322 return false; | |
| 2323 content::PageTransition transition_type = content::PAGE_TRANSITION_LINK; | |
| 2324 NavigationEntry* active_navigation_entry = controller_.GetActiveEntry(); | |
| 2325 if (active_navigation_entry) { | |
| 2326 transition_type = active_navigation_entry->GetTransitionType(); | |
| 2327 } | |
| 2328 return delegate_->ShouldIgnoreNavigation(this, url, referrer, disposition, | |
| 2329 is_content_initiated, | |
| 2330 transition_type); | |
|
Charlie Reis
2012/04/05 17:06:53
I'm not very familiar with ExternalTabContainers.
mkosiba (inactive)
2012/04/10 17:58:37
Neither am I. I don't even have a Windows machine
| |
| 2331 } | |
| 2332 | |
| 2315 void TabContents::RunJavaScriptMessage( | 2333 void TabContents::RunJavaScriptMessage( |
| 2316 RenderViewHost* rvh, | 2334 RenderViewHost* rvh, |
| 2317 const string16& message, | 2335 const string16& message, |
| 2318 const string16& default_prompt, | 2336 const string16& default_prompt, |
| 2319 const GURL& frame_url, | 2337 const GURL& frame_url, |
| 2320 ui::JavascriptMessageType javascript_message_type, | 2338 ui::JavascriptMessageType javascript_message_type, |
| 2321 IPC::Message* reply_msg, | 2339 IPC::Message* reply_msg, |
| 2322 bool* did_suppress_message) { | 2340 bool* did_suppress_message) { |
| 2323 // Suppress JavaScript dialogs when requested. Also suppress messages when | 2341 // Suppress JavaScript dialogs when requested. Also suppress messages when |
| 2324 // showing an interstitial as it's shown over the previous page and we don't | 2342 // showing an interstitial as it's shown over the previous page and we don't |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2596 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2614 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2597 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2615 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2598 // Can be NULL during tests. | 2616 // Can be NULL during tests. |
| 2599 if (rwh_view) | 2617 if (rwh_view) |
| 2600 rwh_view->SetSize(GetView()->GetContainerSize()); | 2618 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2601 } | 2619 } |
| 2602 | 2620 |
| 2603 RenderViewHostImpl* TabContents::GetRenderViewHostImpl() { | 2621 RenderViewHostImpl* TabContents::GetRenderViewHostImpl() { |
| 2604 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2622 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2605 } | 2623 } |
| OLD | NEW |