OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 130 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
131 #include "third_party/WebKit/public/web/WebPlugin.h" | 131 #include "third_party/WebKit/public/web/WebPlugin.h" |
132 #include "third_party/WebKit/public/web/WebPluginParams.h" | 132 #include "third_party/WebKit/public/web/WebPluginParams.h" |
133 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" | 133 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" |
134 #include "third_party/WebKit/public/web/WebRange.h" | 134 #include "third_party/WebKit/public/web/WebRange.h" |
135 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 135 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
136 #include "third_party/WebKit/public/web/WebScriptSource.h" | 136 #include "third_party/WebKit/public/web/WebScriptSource.h" |
137 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 137 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
138 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 138 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
139 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 139 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 140 #include "third_party/WebKit/public/web/WebSettings.h" |
140 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 141 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
141 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 142 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
142 #include "third_party/WebKit/public/web/WebView.h" | 143 #include "third_party/WebKit/public/web/WebView.h" |
143 #include "third_party/mojo/src/mojo/edk/js/core.h" | 144 #include "third_party/mojo/src/mojo/edk/js/core.h" |
144 #include "third_party/mojo/src/mojo/edk/js/support.h" | 145 #include "third_party/mojo/src/mojo/edk/js/support.h" |
145 | 146 |
146 #if defined(ENABLE_PLUGINS) | 147 #if defined(ENABLE_PLUGINS) |
147 #include "content/renderer/npapi/webplugin_impl.h" | 148 #include "content/renderer/npapi/webplugin_impl.h" |
148 #include "content/renderer/pepper/pepper_browser_connection.h" | 149 #include "content/renderer/pepper/pepper_browser_connection.h" |
149 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 150 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 1039 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
1039 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1040 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
1040 OnTextSurroundingSelectionRequest) | 1041 OnTextSurroundingSelectionRequest) |
1041 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, | 1042 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, |
1042 OnAddStyleSheetByURL) | 1043 OnAddStyleSheetByURL) |
1043 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1044 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
1044 OnSetAccessibilityMode) | 1045 OnSetAccessibilityMode) |
1045 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) | 1046 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) |
1046 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1047 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
1047 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 1048 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 1049 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, |
| 1050 OnTextTrackSettingsChanged) |
1048 #if defined(OS_ANDROID) | 1051 #if defined(OS_ANDROID) |
1049 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1052 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
1050 #elif defined(OS_MACOSX) | 1053 #elif defined(OS_MACOSX) |
1051 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1054 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
1052 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 1055 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
1053 #endif | 1056 #endif |
1054 IPC_END_MESSAGE_MAP() | 1057 IPC_END_MESSAGE_MAP() |
1055 | 1058 |
1056 return handled; | 1059 return handled; |
1057 } | 1060 } |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 CHECK(!frame_->parent()); | 1573 CHECK(!frame_->parent()); |
1571 | 1574 |
1572 if (frame_->opener()) | 1575 if (frame_->opener()) |
1573 frame_->setOpener(NULL); | 1576 frame_->setOpener(NULL); |
1574 } | 1577 } |
1575 | 1578 |
1576 void RenderFrameImpl::OnDidUpdateSandboxFlags(SandboxFlags flags) { | 1579 void RenderFrameImpl::OnDidUpdateSandboxFlags(SandboxFlags flags) { |
1577 frame_->setFrameOwnerSandboxFlags(ContentToWebSandboxFlags(flags)); | 1580 frame_->setFrameOwnerSandboxFlags(ContentToWebSandboxFlags(flags)); |
1578 } | 1581 } |
1579 | 1582 |
| 1583 void RenderFrameImpl::OnTextTrackSettingsChanged( |
| 1584 const FrameMsg_TextTrackSettings_Params& params) { |
| 1585 DCHECK(!frame_->parent()); |
| 1586 if (!render_view_->webview()) |
| 1587 return; |
| 1588 render_view_->webview()->settings()->setTextTrackBackgroundColor( |
| 1589 WebString::fromUTF8(params.text_track_background_color)); |
| 1590 render_view_->webview()->settings()->setTextTrackFontFamily( |
| 1591 WebString::fromUTF8(params.text_track_font_family)); |
| 1592 render_view_->webview()->settings()->setTextTrackFontStyle( |
| 1593 WebString::fromUTF8(params.text_track_font_style)); |
| 1594 render_view_->webview()->settings()->setTextTrackFontVariant( |
| 1595 WebString::fromUTF8(params.text_track_font_variant)); |
| 1596 render_view_->webview()->settings()->setTextTrackTextColor( |
| 1597 WebString::fromUTF8(params.text_track_text_color)); |
| 1598 render_view_->webview()->settings()->setTextTrackTextShadow( |
| 1599 WebString::fromUTF8(params.text_track_text_shadow)); |
| 1600 render_view_->webview()->settings()->setTextTrackTextSize( |
| 1601 WebString::fromUTF8(params.text_track_text_size)); |
| 1602 } |
| 1603 |
1580 #if defined(OS_ANDROID) | 1604 #if defined(OS_ANDROID) |
1581 void RenderFrameImpl::OnSelectPopupMenuItems( | 1605 void RenderFrameImpl::OnSelectPopupMenuItems( |
1582 bool canceled, | 1606 bool canceled, |
1583 const std::vector<int>& selected_indices) { | 1607 const std::vector<int>& selected_indices) { |
1584 // It is possible to receive more than one of these calls if the user presses | 1608 // It is possible to receive more than one of these calls if the user presses |
1585 // a select faster than it takes for the show-select-popup IPC message to make | 1609 // a select faster than it takes for the show-select-popup IPC message to make |
1586 // it to the browser UI thread. Ignore the extra-messages. | 1610 // it to the browser UI thread. Ignore the extra-messages. |
1587 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. | 1611 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. |
1588 if (!external_popup_menu_) | 1612 if (!external_popup_menu_) |
1589 return; | 1613 return; |
(...skipping 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4688 | 4712 |
4689 #if defined(ENABLE_BROWSER_CDMS) | 4713 #if defined(ENABLE_BROWSER_CDMS) |
4690 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4714 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4691 if (!cdm_manager_) | 4715 if (!cdm_manager_) |
4692 cdm_manager_ = new RendererCdmManager(this); | 4716 cdm_manager_ = new RendererCdmManager(this); |
4693 return cdm_manager_; | 4717 return cdm_manager_; |
4694 } | 4718 } |
4695 #endif // defined(ENABLE_BROWSER_CDMS) | 4719 #endif // defined(ENABLE_BROWSER_CDMS) |
4696 | 4720 |
4697 } // namespace content | 4721 } // namespace content |
OLD | NEW |