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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2908 // TODO(brettw): It seems bogus to reach into here and initialize the host. | 2908 // TODO(brettw): It seems bogus to reach into here and initialize the host. |
2909 if (is_resume_pending_) { | 2909 if (is_resume_pending_) { |
2910 is_resume_pending_ = false; | 2910 is_resume_pending_ = false; |
2911 GetRenderViewHost()->GetWidget()->Init(); | 2911 GetRenderViewHost()->GetWidget()->Init(); |
2912 GetMainFrame()->Init(); | 2912 GetMainFrame()->Init(); |
2913 } | 2913 } |
2914 } | 2914 } |
2915 | 2915 |
2916 bool WebContentsImpl::FocusLocationBarByDefault() { | 2916 bool WebContentsImpl::FocusLocationBarByDefault() { |
2917 NavigationEntry* entry = controller_.GetVisibleEntry(); | 2917 NavigationEntry* entry = controller_.GetVisibleEntry(); |
2918 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) | 2918 if (entry && |
2919 entry->GetTransitionType() != ui::PageTransition::PAGE_TRANSITION_LINK && | |
2920 entry->GetURL() == GURL(url::kAboutBlankURL)) { | |
Charlie Reis
2016/02/10 05:47:48
Here's what I would recommend (if we decide to kee
palmer
2016/02/10 23:15:25
OK, I did that, and added a sketch of a test that
| |
2919 return true; | 2921 return true; |
2922 } | |
2920 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); | 2923 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); |
2921 } | 2924 } |
2922 | 2925 |
2923 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { | 2926 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { |
2924 if (delegate_) | 2927 if (delegate_) |
2925 delegate_->SetFocusToLocationBar(select_all); | 2928 delegate_->SetFocusToLocationBar(select_all); |
2926 } | 2929 } |
2927 | 2930 |
2928 void WebContentsImpl::DidStartNavigation(NavigationHandle* navigation_handle) { | 2931 void WebContentsImpl::DidStartNavigation(NavigationHandle* navigation_handle) { |
2929 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2932 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
(...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4752 const WebContentsObserver::MediaPlayerId& id) { | 4755 const WebContentsObserver::MediaPlayerId& id) { |
4753 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4756 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4754 } | 4757 } |
4755 | 4758 |
4756 void WebContentsImpl::MediaStoppedPlaying( | 4759 void WebContentsImpl::MediaStoppedPlaying( |
4757 const WebContentsObserver::MediaPlayerId& id) { | 4760 const WebContentsObserver::MediaPlayerId& id) { |
4758 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4761 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4759 } | 4762 } |
4760 | 4763 |
4761 } // namespace content | 4764 } // namespace content |
OLD | NEW |