OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 "config.h" | 5 #include "config.h" |
6 #include "web/ExternalPopupMenu.h" | 6 #include "web/ExternalPopupMenu.h" |
7 | 7 |
8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/PinchViewport.h" | 10 #include "core/frame/PinchViewport.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual int listSize() const override { return m_listSize; } | 58 virtual int listSize() const override { return m_listSize; } |
59 virtual int selectedIndex() const override { return 0; } | 59 virtual int selectedIndex() const override { return 0; } |
60 virtual void popupDidHide() override { } | 60 virtual void popupDidHide() override { } |
61 virtual bool itemIsSeparator(unsigned listIndex) const override { return fal
se;} | 61 virtual bool itemIsSeparator(unsigned listIndex) const override { return fal
se;} |
62 virtual bool itemIsLabel(unsigned listIndex) const override { return false;
} | 62 virtual bool itemIsLabel(unsigned listIndex) const override { return false;
} |
63 virtual bool itemIsSelected(unsigned listIndex) const override { return list
Index == 0;} | 63 virtual bool itemIsSelected(unsigned listIndex) const override { return list
Index == 0;} |
64 virtual void setTextFromItem(unsigned listIndex) override { } | 64 virtual void setTextFromItem(unsigned listIndex) override { } |
65 virtual bool multiple() const override { return false; } | 65 virtual bool multiple() const override { return false; } |
66 virtual IntRect elementRectRelativeToViewport() const override { return IntR
ect(); } | 66 virtual IntRect elementRectRelativeToViewport() const override { return IntR
ect(); } |
67 virtual Element& ownerElement() const override { return *m_ownerElement; } | 67 virtual Element& ownerElement() const override { return *m_ownerElement; } |
68 virtual const LayoutStyle* layoutStyleForItem(Element& element) const overri
de { return nullptr; } | 68 virtual const ComputedStyle* computedStyleForItem(Element& element) const ov
erride { return nullptr; } |
69 | 69 |
70 void setListSize(size_t size) { m_listSize = size; } | 70 void setListSize(size_t size) { m_listSize = size; } |
71 void setDisplayNoneIndex(unsigned index) { m_displayNoneIndexSet.insert(inde
x); } | 71 void setDisplayNoneIndex(unsigned index) { m_displayNoneIndexSet.insert(inde
x); } |
72 void setOwnerElement(PassRefPtrWillBeRawPtr<Element> element) { m_ownerEleme
nt = element; } | 72 void setOwnerElement(PassRefPtrWillBeRawPtr<Element> element) { m_ownerEleme
nt = element; } |
73 private: | 73 private: |
74 size_t m_listSize; | 74 size_t m_listSize; |
75 std::set<unsigned> m_displayNoneIndexSet; | 75 std::set<unsigned> m_displayNoneIndexSet; |
76 RefPtrWillBePersistent<Element> m_ownerElement; | 76 RefPtrWillBePersistent<Element> m_ownerElement; |
77 }; | 77 }; |
78 | 78 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 ASSERT_TRUE(menuList->popupIsVisible()); | 261 ASSERT_TRUE(menuList->popupIsVisible()); |
262 | 262 |
263 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(menuLis
t->popup()); | 263 WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(menuLis
t->popup()); |
264 WebVector<int> indices; | 264 WebVector<int> indices; |
265 client->didAcceptIndices(indices); | 265 client->didAcceptIndices(indices); |
266 EXPECT_FALSE(menuList->popupIsVisible()); | 266 EXPECT_FALSE(menuList->popupIsVisible()); |
267 EXPECT_EQ(-1, select->selectedIndex()); | 267 EXPECT_EQ(-1, select->selectedIndex()); |
268 } | 268 } |
269 | 269 |
270 } // namespace | 270 } // namespace |
OLD | NEW |