| 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 2613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 void WebContentsImpl::DidNavigateMainFramePostCommit( | 2624 void WebContentsImpl::DidNavigateMainFramePostCommit( |
| 2625 const LoadCommittedDetails& details, | 2625 const LoadCommittedDetails& details, |
| 2626 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { | 2626 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { |
| 2627 if (details.is_navigation_to_different_page()) { | 2627 if (details.is_navigation_to_different_page()) { |
| 2628 // Clear the status bubble. This is a workaround for a bug where WebKit | 2628 // Clear the status bubble. This is a workaround for a bug where WebKit |
| 2629 // doesn't let us know that the cursor left an element during a | 2629 // doesn't let us know that the cursor left an element during a |
| 2630 // transition (this is also why the mouse cursor remains as a hand after | 2630 // transition (this is also why the mouse cursor remains as a hand after |
| 2631 // clicking on a link); see bugs 1184641 and 980803. We don't want to | 2631 // clicking on a link); see bugs 1184641 and 980803. We don't want to |
| 2632 // clear the bubble when a user navigates to a named anchor in the same | 2632 // clear the bubble when a user navigates to a named anchor in the same |
| 2633 // page. | 2633 // page. |
| 2634 UpdateTargetURL(details.entry->GetPageID(), GURL()); | 2634 UpdateTargetURL(GURL()); |
| 2635 } | 2635 } |
| 2636 | 2636 |
| 2637 if (!details.is_in_page) { | 2637 if (!details.is_in_page) { |
| 2638 // Once the main frame is navigated, we're no longer considered to have | 2638 // Once the main frame is navigated, we're no longer considered to have |
| 2639 // displayed insecure content. | 2639 // displayed insecure content. |
| 2640 displayed_insecure_content_ = false; | 2640 displayed_insecure_content_ = false; |
| 2641 SSLManager::NotifySSLInternalStateChanged( | 2641 SSLManager::NotifySSLInternalStateChanged( |
| 2642 GetController().GetBrowserContext()); | 2642 GetController().GetBrowserContext()); |
| 2643 } | 2643 } |
| 2644 | 2644 |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3671 if (entry_index < 0) | 3671 if (entry_index < 0) |
| 3672 return; | 3672 return; |
| 3673 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index); | 3673 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index); |
| 3674 | 3674 |
| 3675 if (page_state == entry->GetPageState()) | 3675 if (page_state == entry->GetPageState()) |
| 3676 return; // Nothing to update. | 3676 return; // Nothing to update. |
| 3677 entry->SetPageState(page_state); | 3677 entry->SetPageState(page_state); |
| 3678 controller_.NotifyEntryChanged(entry, entry_index); | 3678 controller_.NotifyEntryChanged(entry, entry_index); |
| 3679 } | 3679 } |
| 3680 | 3680 |
| 3681 void WebContentsImpl::UpdateTargetURL(int32 page_id, const GURL& url) { | 3681 void WebContentsImpl::UpdateTargetURL(const GURL& url) { |
| 3682 if (delegate_) | 3682 if (delegate_) |
| 3683 delegate_->UpdateTargetURL(this, page_id, url); | 3683 delegate_->UpdateTargetURL(this, url); |
| 3684 } | 3684 } |
| 3685 | 3685 |
| 3686 void WebContentsImpl::Close(RenderViewHost* rvh) { | 3686 void WebContentsImpl::Close(RenderViewHost* rvh) { |
| 3687 #if defined(OS_MACOSX) | 3687 #if defined(OS_MACOSX) |
| 3688 // The UI may be in an event-tracking loop, such as between the | 3688 // The UI may be in an event-tracking loop, such as between the |
| 3689 // mouse-down and mouse-up in text selection or a button click. | 3689 // mouse-down and mouse-up in text selection or a button click. |
| 3690 // Defer the close until after tracking is complete, so that we | 3690 // Defer the close until after tracking is complete, so that we |
| 3691 // don't free objects out from under the UI. | 3691 // don't free objects out from under the UI. |
| 3692 // TODO(shess): This could get more fine-grained. For instance, | 3692 // TODO(shess): This could get more fine-grained. For instance, |
| 3693 // closing a tab in another window while selecting text in the | 3693 // closing a tab in another window while selecting text in the |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4391 node->render_manager()->ResumeResponseDeferredAtStart(); | 4391 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4392 } | 4392 } |
| 4393 | 4393 |
| 4394 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4394 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4395 force_disable_overscroll_content_ = force_disable; | 4395 force_disable_overscroll_content_ = force_disable; |
| 4396 if (view_) | 4396 if (view_) |
| 4397 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4397 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4398 } | 4398 } |
| 4399 | 4399 |
| 4400 } // namespace content | 4400 } // namespace content |
| OLD | NEW |