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/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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 635 OnDidDisplayInsecureContent) | 635 OnDidDisplayInsecureContent) |
| 636 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunInsecureContent, | 636 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunInsecureContent, |
| 637 OnDidRunInsecureContent) | 637 OnDidRunInsecureContent) |
| 638 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 638 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
| 639 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 639 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
| 640 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 640 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
| 641 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, | 641 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, |
| 642 OnRegisterProtocolHandler) | 642 OnRegisterProtocolHandler) |
| 643 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, | 643 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, |
| 644 OnUnregisterProtocolHandler) | 644 OnUnregisterProtocolHandler) |
| 645 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, | |
| 646 OnUpdatePageImportanceSignals) | |
| 645 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 647 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
| 646 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 648 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
| 647 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) | 649 IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend) |
| 648 #if defined(ENABLE_PLUGINS) | 650 #if defined(ENABLE_PLUGINS) |
| 649 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, | 651 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated, |
| 650 OnPepperInstanceCreated) | 652 OnPepperInstanceCreated) |
| 651 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, | 653 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted, |
| 652 OnPepperInstanceDeleted) | 654 OnPepperInstanceDeleted) |
| 653 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 655 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
| 654 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) | 656 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 904 #if defined(OS_WIN) | 906 #if defined(OS_WIN) |
| 905 void WebContentsImpl::SetParentNativeViewAccessible( | 907 void WebContentsImpl::SetParentNativeViewAccessible( |
| 906 gfx::NativeViewAccessible accessible_parent) { | 908 gfx::NativeViewAccessible accessible_parent) { |
| 907 accessible_parent_ = accessible_parent; | 909 accessible_parent_ = accessible_parent; |
| 908 RenderFrameHostImpl* rfh = GetMainFrame(); | 910 RenderFrameHostImpl* rfh = GetMainFrame(); |
| 909 if (rfh) | 911 if (rfh) |
| 910 rfh->SetParentNativeViewAccessible(accessible_parent); | 912 rfh->SetParentNativeViewAccessible(accessible_parent); |
| 911 } | 913 } |
| 912 #endif | 914 #endif |
| 913 | 915 |
| 916 const PageImportanceSignals* WebContentsImpl::GetPageImportanceSignals() const { | |
|
kinuko
2015/09/24 00:26:22
nit: maybe could be a const ref if this can't be n
kouhei (in TOK)
2015/09/24 01:13:46
Done.
| |
| 917 return &page_importance_signals_; | |
| 918 } | |
| 919 | |
| 914 const base::string16& WebContentsImpl::GetTitle() const { | 920 const base::string16& WebContentsImpl::GetTitle() const { |
| 915 // Transient entries take precedence. They are used for interstitial pages | 921 // Transient entries take precedence. They are used for interstitial pages |
| 916 // that are shown on top of existing pages. | 922 // that are shown on top of existing pages. |
| 917 NavigationEntry* entry = controller_.GetTransientEntry(); | 923 NavigationEntry* entry = controller_.GetTransientEntry(); |
| 918 std::string accept_languages = | 924 std::string accept_languages = |
| 919 GetContentClient()->browser()->GetAcceptLangs( | 925 GetContentClient()->browser()->GetAcceptLangs( |
| 920 GetBrowserContext()); | 926 GetBrowserContext()); |
| 921 if (entry) { | 927 if (entry) { |
| 922 return entry->GetTitleForDisplay(accept_languages); | 928 return entry->GetTitleForDisplay(accept_languages); |
| 923 } | 929 } |
| (...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3159 return; | 3165 return; |
| 3160 | 3166 |
| 3161 ChildProcessSecurityPolicyImpl* policy = | 3167 ChildProcessSecurityPolicyImpl* policy = |
| 3162 ChildProcessSecurityPolicyImpl::GetInstance(); | 3168 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 3163 if (policy->IsPseudoScheme(protocol)) | 3169 if (policy->IsPseudoScheme(protocol)) |
| 3164 return; | 3170 return; |
| 3165 | 3171 |
| 3166 delegate_->UnregisterProtocolHandler(this, protocol, url, user_gesture); | 3172 delegate_->UnregisterProtocolHandler(this, protocol, url, user_gesture); |
| 3167 } | 3173 } |
| 3168 | 3174 |
| 3175 void WebContentsImpl::OnUpdatePageImportanceSignals( | |
| 3176 const PageImportanceSignals& signals) { | |
| 3177 page_importance_signals_ = signals; | |
| 3178 } | |
| 3179 | |
| 3169 void WebContentsImpl::OnFindReply(int request_id, | 3180 void WebContentsImpl::OnFindReply(int request_id, |
| 3170 int number_of_matches, | 3181 int number_of_matches, |
| 3171 const gfx::Rect& selection_rect, | 3182 const gfx::Rect& selection_rect, |
| 3172 int active_match_ordinal, | 3183 int active_match_ordinal, |
| 3173 bool final_update) { | 3184 bool final_update) { |
| 3174 if (delegate_) { | 3185 if (delegate_) { |
| 3175 delegate_->FindReply(this, request_id, number_of_matches, selection_rect, | 3186 delegate_->FindReply(this, request_id, number_of_matches, selection_rect, |
| 3176 active_match_ordinal, final_update); | 3187 active_match_ordinal, final_update); |
| 3177 } | 3188 } |
| 3178 } | 3189 } |
| (...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4635 return NULL; | 4646 return NULL; |
| 4636 } | 4647 } |
| 4637 | 4648 |
| 4638 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4649 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4639 force_disable_overscroll_content_ = force_disable; | 4650 force_disable_overscroll_content_ = force_disable; |
| 4640 if (view_) | 4651 if (view_) |
| 4641 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4652 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4642 } | 4653 } |
| 4643 | 4654 |
| 4644 } // namespace content | 4655 } // namespace content |
| OLD | NEW |