Chromium Code Reviews| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 128 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
| 129 #include "third_party/WebKit/public/web/WebPlugin.h" | 129 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 130 #include "third_party/WebKit/public/web/WebPluginParams.h" | 130 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 131 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" | 131 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" |
| 132 #include "third_party/WebKit/public/web/WebRange.h" | 132 #include "third_party/WebKit/public/web/WebRange.h" |
| 133 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 133 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
| 134 #include "third_party/WebKit/public/web/WebScriptSource.h" | 134 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 135 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 135 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
| 136 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 136 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
| 137 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 137 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 138 #include "third_party/WebKit/public/web/WebSettings.h" | |
| 138 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 139 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
| 139 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 140 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 140 #include "third_party/WebKit/public/web/WebView.h" | 141 #include "third_party/WebKit/public/web/WebView.h" |
| 141 #include "third_party/mojo/src/mojo/edk/js/core.h" | 142 #include "third_party/mojo/src/mojo/edk/js/core.h" |
| 142 #include "third_party/mojo/src/mojo/edk/js/support.h" | 143 #include "third_party/mojo/src/mojo/edk/js/support.h" |
| 143 | 144 |
| 144 #if defined(ENABLE_PLUGINS) | 145 #if defined(ENABLE_PLUGINS) |
| 145 #include "content/renderer/npapi/webplugin_impl.h" | 146 #include "content/renderer/npapi/webplugin_impl.h" |
| 146 #include "content/renderer/pepper/pepper_browser_connection.h" | 147 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 147 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 148 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1014 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 1015 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 1015 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1016 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
| 1016 OnTextSurroundingSelectionRequest) | 1017 OnTextSurroundingSelectionRequest) |
| 1017 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, | 1018 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, |
| 1018 OnAddStyleSheetByURL) | 1019 OnAddStyleSheetByURL) |
| 1019 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1020 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
| 1020 OnSetAccessibilityMode) | 1021 OnSetAccessibilityMode) |
| 1021 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) | 1022 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) |
| 1022 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1023 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| 1023 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 1024 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 1025 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, | |
| 1026 OnTextTrackSettingsChanged) | |
| 1024 #if defined(OS_ANDROID) | 1027 #if defined(OS_ANDROID) |
| 1025 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1028 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
| 1026 #elif defined(OS_MACOSX) | 1029 #elif defined(OS_MACOSX) |
| 1027 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1030 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 1028 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 1031 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
| 1029 #endif | 1032 #endif |
| 1030 IPC_END_MESSAGE_MAP() | 1033 IPC_END_MESSAGE_MAP() |
| 1031 | 1034 |
| 1032 return handled; | 1035 return handled; |
| 1033 } | 1036 } |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 CHECK(!frame_->parent()); | 1541 CHECK(!frame_->parent()); |
| 1539 | 1542 |
| 1540 if (frame_->opener()) | 1543 if (frame_->opener()) |
| 1541 frame_->setOpener(NULL); | 1544 frame_->setOpener(NULL); |
| 1542 } | 1545 } |
| 1543 | 1546 |
| 1544 void RenderFrameImpl::OnDidUpdateSandboxFlags(SandboxFlags flags) { | 1547 void RenderFrameImpl::OnDidUpdateSandboxFlags(SandboxFlags flags) { |
| 1545 frame_->setFrameOwnerSandboxFlags(ContentToWebSandboxFlags(flags)); | 1548 frame_->setFrameOwnerSandboxFlags(ContentToWebSandboxFlags(flags)); |
| 1546 } | 1549 } |
| 1547 | 1550 |
| 1551 void RenderFrameImpl::OnTextTrackSettingsChanged( | |
| 1552 const FrameMsg_TextTrackSettings_Params& params) { | |
|
nasko
2015/03/12 20:53:53
If this is only expected for the top-level frame,
| |
| 1553 if (!render_view_->webview()) | |
| 1554 return; | |
| 1555 render_view_->webview()->settings()->setTextTrackBackgroundColor( | |
| 1556 WebString::fromUTF8(params.text_track_background_color)); | |
| 1557 render_view_->webview()->settings()->setTextTrackFontFamily( | |
| 1558 WebString::fromUTF8(params.text_track_font_family)); | |
| 1559 render_view_->webview()->settings()->setTextTrackFontStyle( | |
| 1560 WebString::fromUTF8(params.text_track_font_style)); | |
| 1561 render_view_->webview()->settings()->setTextTrackFontVariant( | |
| 1562 WebString::fromUTF8(params.text_track_font_variant)); | |
| 1563 render_view_->webview()->settings()->setTextTrackTextColor( | |
| 1564 WebString::fromUTF8(params.text_track_text_color)); | |
| 1565 render_view_->webview()->settings()->setTextTrackTextShadow( | |
| 1566 WebString::fromUTF8(params.text_track_text_shadow)); | |
| 1567 render_view_->webview()->settings()->setTextTrackTextSize( | |
| 1568 WebString::fromUTF8(params.text_track_text_size)); | |
| 1569 } | |
| 1570 | |
| 1548 #if defined(OS_ANDROID) | 1571 #if defined(OS_ANDROID) |
| 1549 void RenderFrameImpl::OnSelectPopupMenuItems( | 1572 void RenderFrameImpl::OnSelectPopupMenuItems( |
| 1550 bool canceled, | 1573 bool canceled, |
| 1551 const std::vector<int>& selected_indices) { | 1574 const std::vector<int>& selected_indices) { |
| 1552 // It is possible to receive more than one of these calls if the user presses | 1575 // It is possible to receive more than one of these calls if the user presses |
| 1553 // a select faster than it takes for the show-select-popup IPC message to make | 1576 // a select faster than it takes for the show-select-popup IPC message to make |
| 1554 // it to the browser UI thread. Ignore the extra-messages. | 1577 // it to the browser UI thread. Ignore the extra-messages. |
| 1555 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. | 1578 // TODO(jcivelli): http:/b/5793321 Implement a better fix, as detailed in bug. |
| 1556 if (!external_popup_menu_) | 1579 if (!external_popup_menu_) |
| 1557 return; | 1580 return; |
| (...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4510 | 4533 |
| 4511 #if defined(ENABLE_BROWSER_CDMS) | 4534 #if defined(ENABLE_BROWSER_CDMS) |
| 4512 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4535 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 4513 if (!cdm_manager_) | 4536 if (!cdm_manager_) |
| 4514 cdm_manager_ = new RendererCdmManager(this); | 4537 cdm_manager_ = new RendererCdmManager(this); |
| 4515 return cdm_manager_; | 4538 return cdm_manager_; |
| 4516 } | 4539 } |
| 4517 #endif // defined(ENABLE_BROWSER_CDMS) | 4540 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4518 | 4541 |
| 4519 } // namespace content | 4542 } // namespace content |
| OLD | NEW |