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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
773 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 773 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
774 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 774 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
775 OnTextSurroundingSelectionRequest) | 775 OnTextSurroundingSelectionRequest) |
776 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, | 776 IPC_MESSAGE_HANDLER(FrameMsg_AddStyleSheetByURL, |
777 OnAddStyleSheetByURL) | 777 OnAddStyleSheetByURL) |
778 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 778 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
779 OnSetAccessibilityMode) | 779 OnSetAccessibilityMode) |
780 #if defined(OS_MACOSX) | 780 #if defined(OS_MACOSX) |
781 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 781 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
782 #endif | 782 #endif |
783 IPC_MESSAGE_HANDLER(FrameMsg_DisownOpener, OnDisownOpener) | |
nasko
2014/08/25 15:47:14
nit: Don't put IPC handlers after the #ifdef'd one
Charlie Reis
2014/08/25 17:10:24
Done.
| |
783 IPC_END_MESSAGE_MAP() | 784 IPC_END_MESSAGE_MAP() |
784 | 785 |
785 return handled; | 786 return handled; |
786 } | 787 } |
787 | 788 |
788 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { | 789 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { |
789 MaybeHandleDebugURL(params.url); | 790 MaybeHandleDebugURL(params.url); |
790 if (!render_view_->webview()) | 791 if (!render_view_->webview()) |
791 return; | 792 return; |
792 | 793 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1154 // Since the find pasteboard supports only plain text, this can be simpler | 1155 // Since the find pasteboard supports only plain text, this can be simpler |
1155 // than the |OnCopy()| case. | 1156 // than the |OnCopy()| case. |
1156 if (frame_->hasSelection()) { | 1157 if (frame_->hasSelection()) { |
1157 base::string16 selection = frame_->selectionAsText(); | 1158 base::string16 selection = frame_->selectionAsText(); |
1158 RenderThread::Get()->Send( | 1159 RenderThread::Get()->Send( |
1159 new ClipboardHostMsg_FindPboardWriteStringAsync(selection)); | 1160 new ClipboardHostMsg_FindPboardWriteStringAsync(selection)); |
1160 } | 1161 } |
1161 } | 1162 } |
1162 #endif | 1163 #endif |
1163 | 1164 |
1165 void RenderFrameImpl::OnDisownOpener() { | |
1166 if (frame_->opener()) | |
nasko
2014/08/25 15:47:14
Should we restrict this to main frames only? I'm n
Charlie Reis
2014/08/25 17:10:24
I've changed it to have a check and a TODO. We'll
| |
1167 frame_->setOpener(NULL); | |
1168 } | |
1169 | |
1164 void RenderFrameImpl::OnDelete() { | 1170 void RenderFrameImpl::OnDelete() { |
1165 frame_->executeCommand(WebString::fromUTF8("Delete"), GetFocusedElement()); | 1171 frame_->executeCommand(WebString::fromUTF8("Delete"), GetFocusedElement()); |
1166 } | 1172 } |
1167 | 1173 |
1168 void RenderFrameImpl::OnSelectAll() { | 1174 void RenderFrameImpl::OnSelectAll() { |
1169 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); | 1175 base::AutoReset<bool> handling_select_range(&handling_select_range_, true); |
1170 frame_->executeCommand(WebString::fromUTF8("SelectAll"), GetFocusedElement()); | 1176 frame_->executeCommand(WebString::fromUTF8("SelectAll"), GetFocusedElement()); |
1171 } | 1177 } |
1172 | 1178 |
1173 void RenderFrameImpl::OnSelectRange(const gfx::Point& start, | 1179 void RenderFrameImpl::OnSelectRange(const gfx::Point& start, |
(...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3752 | 3758 |
3753 #if defined(ENABLE_BROWSER_CDMS) | 3759 #if defined(ENABLE_BROWSER_CDMS) |
3754 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3760 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3755 if (!cdm_manager_) | 3761 if (!cdm_manager_) |
3756 cdm_manager_ = new RendererCdmManager(this); | 3762 cdm_manager_ = new RendererCdmManager(this); |
3757 return cdm_manager_; | 3763 return cdm_manager_; |
3758 } | 3764 } |
3759 #endif // defined(ENABLE_BROWSER_CDMS) | 3765 #endif // defined(ENABLE_BROWSER_CDMS) |
3760 | 3766 |
3761 } // namespace content | 3767 } // namespace content |
OLD | NEW |