| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 virtual void popupDidHide() { } | 119 virtual void popupDidHide() { } |
| 120 virtual bool itemIsSeparator(unsigned listIndex) const { return false; } | 120 virtual bool itemIsSeparator(unsigned listIndex) const { return false; } |
| 121 virtual bool itemIsLabel(unsigned listIndex) const { return false; } | 121 virtual bool itemIsLabel(unsigned listIndex) const { return false; } |
| 122 virtual bool itemIsSelected(unsigned listIndex) const { return listIndex ==
m_selectIndex; } | 122 virtual bool itemIsSelected(unsigned listIndex) const { return listIndex ==
m_selectIndex; } |
| 123 virtual bool valueShouldChangeOnHotTrack() const { return false; } | 123 virtual bool valueShouldChangeOnHotTrack() const { return false; } |
| 124 virtual void setTextFromItem(unsigned listIndex) { } | 124 virtual void setTextFromItem(unsigned listIndex) { } |
| 125 | 125 |
| 126 virtual FontSelector* fontSelector() const { return 0; } | 126 virtual FontSelector* fontSelector() const { return 0; } |
| 127 virtual HostWindow* hostWindow() const { return 0; } | 127 virtual HostWindow* hostWindow() const { return 0; } |
| 128 | 128 |
| 129 virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrie
ntation, ScrollbarControlSize) { return nullptr; } | 129 virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollableArea*, S
crollbarOrientation, ScrollbarControlSize) { return nullptr; } |
| 130 | 130 |
| 131 void setDisabledIndex(unsigned index) { m_disabledIndexSet.insert(index); } | 131 void setDisabledIndex(unsigned index) { m_disabledIndexSet.insert(index); } |
| 132 void setFocusedNode(Node* node) { m_node = node; } | 132 void setFocusedNode(Node* node) { m_node = node; } |
| 133 void setListSize(int listSize) { m_listSize = listSize; } | 133 void setListSize(int listSize) { m_listSize = listSize; } |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 unsigned m_selectIndex; | 136 unsigned m_selectIndex; |
| 137 std::set<unsigned> m_disabledIndexSet; | 137 std::set<unsigned> m_disabledIndexSet; |
| 138 Node* m_node; | 138 Node* m_node; |
| 139 int m_listSize; | 139 int m_listSize; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 protected: | 189 protected: |
| 190 virtual void SetUp() | 190 virtual void SetUp() |
| 191 { | 191 { |
| 192 m_helper.initialize(false, 0, &m_webviewClient); | 192 m_helper.initialize(false, 0, &m_webviewClient); |
| 193 m_popupMenu = adoptRefWillBeNoop(new PopupMenuChromium(*mainFrame()->fra
me(), &m_popupMenuClient)); | 193 m_popupMenu = adoptRefWillBeNoop(new PopupMenuChromium(*mainFrame()->fra
me(), &m_popupMenuClient)); |
| 194 } | 194 } |
| 195 | 195 |
| 196 virtual void TearDown() | 196 virtual void TearDown() |
| 197 { | 197 { |
| 198 m_popupMenu->disconnectClient(); |
| 198 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 199 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
| 199 } | 200 } |
| 200 | 201 |
| 201 // Returns true if there currently is a select popup in the WebView. | 202 // Returns true if there currently is a select popup in the WebView. |
| 202 bool popupOpen() const { return webView()->selectPopup(); } | 203 bool popupOpen() const { return webView()->selectPopup(); } |
| 203 | 204 |
| 204 int selectedIndex() const { return m_popupMenuClient.selectedIndex(); } | 205 int selectedIndex() const { return m_popupMenuClient.selectedIndex(); } |
| 205 | 206 |
| 206 void showPopup() | 207 void showPopup() |
| 207 { | 208 { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 ASSERT(menuList); | 603 ASSERT(menuList); |
| 603 menuList->showPopup(); | 604 menuList->showPopup(); |
| 604 ASSERT(popupOpen()); | 605 ASSERT(popupOpen()); |
| 605 PopupListBox* listBox = webView()->selectPopup()->listBox(); | 606 PopupListBox* listBox = webView()->selectPopup()->listBox(); |
| 606 int ltrWidth = listBox->getRowBaseWidth(0); | 607 int ltrWidth = listBox->getRowBaseWidth(0); |
| 607 int rtlWidth = listBox->getRowBaseWidth(1); | 608 int rtlWidth = listBox->getRowBaseWidth(1); |
| 608 EXPECT_LT(rtlWidth, ltrWidth); | 609 EXPECT_LT(rtlWidth, ltrWidth); |
| 609 } | 610 } |
| 610 | 611 |
| 611 } // namespace | 612 } // namespace |
| OLD | NEW |