Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 309143002: Navigation transitions: Added "addStyleSheetByURL" function to insert stylesheet links. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698