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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 OnJavaScriptExecuteRequest) | 707 OnJavaScriptExecuteRequest) |
708 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, | 708 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, |
709 OnSetEditableSelectionOffsets) | 709 OnSetEditableSelectionOffsets) |
710 IPC_MESSAGE_HANDLER(FrameMsg_SetCompositionFromExistingText, | 710 IPC_MESSAGE_HANDLER(FrameMsg_SetCompositionFromExistingText, |
711 OnSetCompositionFromExistingText) | 711 OnSetCompositionFromExistingText) |
712 IPC_MESSAGE_HANDLER(FrameMsg_ExtendSelectionAndDelete, | 712 IPC_MESSAGE_HANDLER(FrameMsg_ExtendSelectionAndDelete, |
713 OnExtendSelectionAndDelete) | 713 OnExtendSelectionAndDelete) |
714 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 714 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
715 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 715 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
716 OnTextSurroundingSelectionRequest) | 716 OnTextSurroundingSelectionRequest) |
| 717 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, |
| 718 OnAddStyleSheetByURL) |
717 #if defined(OS_MACOSX) | 719 #if defined(OS_MACOSX) |
718 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 720 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
719 #endif | 721 #endif |
720 IPC_END_MESSAGE_MAP() | 722 IPC_END_MESSAGE_MAP() |
721 | 723 |
722 return handled; | 724 return handled; |
723 } | 725 } |
724 | 726 |
725 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { | 727 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { |
726 MaybeHandleDebugURL(params.url); | 728 MaybeHandleDebugURL(params.url); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 return; | 1215 return; |
1214 } | 1216 } |
1215 | 1217 |
1216 Send(new FrameHostMsg_TextSurroundingSelectionResponse( | 1218 Send(new FrameHostMsg_TextSurroundingSelectionResponse( |
1217 routing_id_, | 1219 routing_id_, |
1218 surroundingText.textContent(), | 1220 surroundingText.textContent(), |
1219 surroundingText.startOffsetInTextContent(), | 1221 surroundingText.startOffsetInTextContent(), |
1220 surroundingText.endOffsetInTextContent())); | 1222 surroundingText.endOffsetInTextContent())); |
1221 } | 1223 } |
1222 | 1224 |
| 1225 void RenderFrameImpl::OnAddStyleSheetByURL(const std::string& url) { |
| 1226 frame_->addStyleSheetByURL(WebString::fromUTF8(url)); |
| 1227 } |
| 1228 |
1223 bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams( | 1229 bool RenderFrameImpl::ShouldUpdateSelectionTextFromContextMenuParams( |
1224 const base::string16& selection_text, | 1230 const base::string16& selection_text, |
1225 size_t selection_text_offset, | 1231 size_t selection_text_offset, |
1226 const gfx::Range& selection_range, | 1232 const gfx::Range& selection_range, |
1227 const ContextMenuParams& params) { | 1233 const ContextMenuParams& params) { |
1228 base::string16 trimmed_selection_text; | 1234 base::string16 trimmed_selection_text; |
1229 if (!selection_text.empty() && !selection_range.is_empty()) { | 1235 if (!selection_text.empty() && !selection_range.is_empty()) { |
1230 const int start = selection_range.GetMin() - selection_text_offset; | 1236 const int start = selection_range.GetMin() - selection_text_offset; |
1231 const size_t length = selection_range.length(); | 1237 const size_t length = selection_range.length(); |
1232 if (start >= 0 && start + length <= selection_text.length()) { | 1238 if (start >= 0 && start + length <= selection_text.length()) { |
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3593 | 3599 |
3594 #if defined(ENABLE_BROWSER_CDMS) | 3600 #if defined(ENABLE_BROWSER_CDMS) |
3595 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3601 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3596 if (!cdm_manager_) | 3602 if (!cdm_manager_) |
3597 cdm_manager_ = new RendererCdmManager(this); | 3603 cdm_manager_ = new RendererCdmManager(this); |
3598 return cdm_manager_; | 3604 return cdm_manager_; |
3599 } | 3605 } |
3600 #endif // defined(ENABLE_BROWSER_CDMS) | 3606 #endif // defined(ENABLE_BROWSER_CDMS) |
3601 | 3607 |
3602 } // namespace content | 3608 } // namespace content |
OLD | NEW |