| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "public/web/WebSelection.h" | 5 #include "public/web/WebSelection.h" | 
| 6 | 6 | 
| 7 #include "core/editing/SelectionType.h" | 7 #include "core/editing/SelectionType.h" | 
| 8 #include "core/layout/compositing/CompositedSelection.h" | 8 #include "core/layout/compositing/CompositedSelection.h" | 
| 9 | 9 | 
| 10 namespace blink { | 10 namespace blink { | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 28   } | 28   } | 
| 29 | 29 | 
| 30   WebSelectionBound result(type); | 30   WebSelectionBound result(type); | 
| 31   result.layerId = bound.layer->platformLayer()->id(); | 31   result.layerId = bound.layer->platformLayer()->id(); | 
| 32   result.edgeTopInLayer = roundedIntPoint(bound.edgeTopInLayer); | 32   result.edgeTopInLayer = roundedIntPoint(bound.edgeTopInLayer); | 
| 33   result.edgeBottomInLayer = roundedIntPoint(bound.edgeBottomInLayer); | 33   result.edgeBottomInLayer = roundedIntPoint(bound.edgeBottomInLayer); | 
| 34   result.isTextDirectionRTL = bound.isTextDirectionRTL; | 34   result.isTextDirectionRTL = bound.isTextDirectionRTL; | 
| 35   return result; | 35   return result; | 
| 36 } | 36 } | 
| 37 | 37 | 
| 38 // SelectionType enums have the same values; enforced in AssertMatchingEnums.cpp
    . | 38 // SelectionType enums have the same values; enforced in | 
|  | 39 // AssertMatchingEnums.cpp. | 
| 39 WebSelection::WebSelection(const CompositedSelection& selection) | 40 WebSelection::WebSelection(const CompositedSelection& selection) | 
| 40     : m_selectionType(static_cast<WebSelection::SelectionType>(selection.type)), | 41     : m_selectionType(static_cast<WebSelection::SelectionType>(selection.type)), | 
| 41       m_start(getWebSelectionBound(selection, true)), | 42       m_start(getWebSelectionBound(selection, true)), | 
| 42       m_end(getWebSelectionBound(selection, false)), | 43       m_end(getWebSelectionBound(selection, false)), | 
| 43       m_isEditable(selection.isEditable), | 44       m_isEditable(selection.isEditable), | 
| 44       m_isEmptyTextFormControl(selection.isEmptyTextFormControl) {} | 45       m_isEmptyTextFormControl(selection.isEmptyTextFormControl) {} | 
| 45 | 46 | 
| 46 WebSelection::WebSelection(const WebSelection& other) | 47 WebSelection::WebSelection(const WebSelection& other) | 
| 47     : m_selectionType(other.m_selectionType), | 48     : m_selectionType(other.m_selectionType), | 
| 48       m_start(other.m_start), | 49       m_start(other.m_start), | 
| 49       m_end(other.m_end), | 50       m_end(other.m_end), | 
| 50       m_isEditable(other.m_isEditable), | 51       m_isEditable(other.m_isEditable), | 
| 51       m_isEmptyTextFormControl(other.m_isEmptyTextFormControl) {} | 52       m_isEmptyTextFormControl(other.m_isEmptyTextFormControl) {} | 
| 52 | 53 | 
| 53 }  // namespace blink | 54 }  // namespace blink | 
| OLD | NEW | 
|---|