OLD | NEW |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #include "core/editing/spellcheck/SpellChecker.h" | 55 #include "core/editing/spellcheck/SpellChecker.h" |
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/HTMLFrameElementBase.h" | 62 #include "core/html/HTMLFrameElementBase.h" |
63 #include "core/html/HTMLInputElement.h" | 63 #include "core/html/HTMLInputElement.h" |
64 #include "core/html/HTMLSelectElement.h" | 64 #include "core/html/HTMLSelectElement.h" |
| 65 #include "core/input/ContextMenuAllowedScope.h" |
65 #include "core/input/EventHandler.h" | 66 #include "core/input/EventHandler.h" |
66 #include "core/layout/HitTestRequest.h" | 67 #include "core/layout/HitTestRequest.h" |
67 #include "core/layout/HitTestResult.h" | 68 #include "core/layout/HitTestResult.h" |
68 #include "core/layout/LayoutPart.h" | 69 #include "core/layout/LayoutPart.h" |
69 #include "core/layout/api/LayoutViewItem.h" | 70 #include "core/layout/api/LayoutViewItem.h" |
70 #include "core/loader/DocumentLoader.h" | 71 #include "core/loader/DocumentLoader.h" |
71 #include "core/page/EditorClient.h" | 72 #include "core/page/EditorClient.h" |
72 #include "core/page/FocusController.h" | 73 #include "core/page/FocusController.h" |
73 #include "core/page/FrameTree.h" | 74 #include "core/page/FrameTree.h" |
74 #include "core/page/Page.h" | 75 #include "core/page/Page.h" |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 709 } |
709 | 710 |
710 // TODO(editing-dev): Should we pass in user_triggered? | 711 // TODO(editing-dev): Should we pass in user_triggered? |
711 SetSelection(SelectionInDOMTree::Builder() | 712 SetSelection(SelectionInDOMTree::Builder() |
712 .SelectAllChildren(*root) | 713 .SelectAllChildren(*root) |
713 .SetIsHandleVisible(IsHandleVisible()) | 714 .SetIsHandleVisible(IsHandleVisible()) |
714 .Build()); | 715 .Build()); |
715 SelectFrameElementInParentIfFullySelected(); | 716 SelectFrameElementInParentIfFullySelected(); |
716 // TODO(editing-dev): Should we pass in user_triggered? | 717 // TODO(editing-dev): Should we pass in user_triggered? |
717 NotifyTextControlOfSelectionChange(kUserTriggered); | 718 NotifyTextControlOfSelectionChange(kUserTriggered); |
| 719 { |
| 720 ContextMenuAllowedScope scope; |
| 721 frame_->GetEventHandler().SendContextMenuEventForTouchSelection( |
| 722 kMenuSourceSelectAll); |
| 723 } |
718 } | 724 } |
719 | 725 |
720 bool FrameSelection::SetSelectedRange(const EphemeralRange& range, | 726 bool FrameSelection::SetSelectedRange(const EphemeralRange& range, |
721 TextAffinity affinity, | 727 TextAffinity affinity, |
722 SelectionDirectionalMode directional, | 728 SelectionDirectionalMode directional, |
723 SetSelectionOptions options) { | 729 SetSelectionOptions options) { |
724 if (range.IsNull()) | 730 if (range.IsNull()) |
725 return false; | 731 return false; |
726 SetSelection(SelectionInDOMTree::Builder() | 732 SetSelection(SelectionInDOMTree::Builder() |
727 .SetBaseAndExtent(range) | 733 .SetBaseAndExtent(range) |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 } | 1189 } |
1184 | 1190 |
1185 void showTree(const blink::FrameSelection* sel) { | 1191 void showTree(const blink::FrameSelection* sel) { |
1186 if (sel) | 1192 if (sel) |
1187 sel->ShowTreeForThis(); | 1193 sel->ShowTreeForThis(); |
1188 else | 1194 else |
1189 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1195 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
1190 } | 1196 } |
1191 | 1197 |
1192 #endif | 1198 #endif |
OLD | NEW |