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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: Fixing rebase bug Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "core/events/Event.h" 56 #include "core/events/Event.h"
57 #include "core/frame/FrameView.h" 57 #include "core/frame/FrameView.h"
58 #include "core/frame/LocalDOMWindow.h" 58 #include "core/frame/LocalDOMWindow.h"
59 #include "core/frame/LocalFrame.h" 59 #include "core/frame/LocalFrame.h"
60 #include "core/frame/Settings.h" 60 #include "core/frame/Settings.h"
61 #include "core/html/HTMLBodyElement.h" 61 #include "core/html/HTMLBodyElement.h"
62 #include "core/html/HTMLFormElement.h" 62 #include "core/html/HTMLFormElement.h"
63 #include "core/html/HTMLFrameElementBase.h" 63 #include "core/html/HTMLFrameElementBase.h"
64 #include "core/html/HTMLInputElement.h" 64 #include "core/html/HTMLInputElement.h"
65 #include "core/html/HTMLSelectElement.h" 65 #include "core/html/HTMLSelectElement.h"
66 #include "core/input/ContextMenuAllowedScope.h"
66 #include "core/input/EventHandler.h" 67 #include "core/input/EventHandler.h"
67 #include "core/layout/HitTestRequest.h" 68 #include "core/layout/HitTestRequest.h"
68 #include "core/layout/HitTestResult.h" 69 #include "core/layout/HitTestResult.h"
69 #include "core/layout/LayoutPart.h" 70 #include "core/layout/LayoutPart.h"
70 #include "core/layout/api/LayoutViewItem.h" 71 #include "core/layout/api/LayoutViewItem.h"
71 #include "core/loader/DocumentLoader.h" 72 #include "core/loader/DocumentLoader.h"
72 #include "core/page/EditorClient.h" 73 #include "core/page/EditorClient.h"
73 #include "core/page/FocusController.h" 74 #include "core/page/FocusController.h"
74 #include "core/page/FrameTree.h" 75 #include "core/page/FrameTree.h"
75 #include "core/page/Page.h" 76 #include "core/page/Page.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 if (!root->isConnected() || expected_document != root->GetDocument()) 664 if (!root->isConnected() || expected_document != root->GetDocument())
664 return; 665 return;
665 } 666 }
666 667
667 SetSelection(SelectionInDOMTree::Builder() 668 SetSelection(SelectionInDOMTree::Builder()
668 .SelectAllChildren(*root) 669 .SelectAllChildren(*root)
669 .SetIsHandleVisible(IsHandleVisible()) 670 .SetIsHandleVisible(IsHandleVisible())
670 .Build()); 671 .Build());
671 SelectFrameElementInParentIfFullySelected(); 672 SelectFrameElementInParentIfFullySelected();
672 NotifyLayoutObjectOfSelectionChange(kUserTriggered); 673 NotifyLayoutObjectOfSelectionChange(kUserTriggered);
674 {
675 ContextMenuAllowedScope scope;
676 frame_->GetEventHandler().SendContextMenuEventForTouchSelection();
677 }
673 } 678 }
674 679
675 bool FrameSelection::SetSelectedRange(const EphemeralRange& range, 680 bool FrameSelection::SetSelectedRange(const EphemeralRange& range,
676 TextAffinity affinity, 681 TextAffinity affinity,
677 SelectionDirectionalMode directional, 682 SelectionDirectionalMode directional,
678 SetSelectionOptions options) { 683 SetSelectionOptions options) {
679 if (range.IsNull()) 684 if (range.IsNull())
680 return false; 685 return false;
681 SetSelection(SelectionInDOMTree::Builder() 686 SetSelection(SelectionInDOMTree::Builder()
682 .SetBaseAndExtent(range) 687 .SetBaseAndExtent(range)
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 } 1186 }
1182 1187
1183 void showTree(const blink::FrameSelection* sel) { 1188 void showTree(const blink::FrameSelection* sel) {
1184 if (sel) 1189 if (sel)
1185 sel->ShowTreeForThis(); 1190 sel->ShowTreeForThis();
1186 else 1191 else
1187 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1192 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1188 } 1193 }
1189 1194
1190 #endif 1195 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698