| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 virtual WebCore::HostWindow* hostWindow() const; | 99 virtual WebCore::HostWindow* hostWindow() const; |
| 100 virtual PassRefPtr<WebCore::Scrollbar> createScrollbar( | 100 virtual PassRefPtr<WebCore::Scrollbar> createScrollbar( |
| 101 WebCore::ScrollableArea* client, | 101 WebCore::ScrollableArea* client, |
| 102 WebCore::ScrollbarOrientation orientation, | 102 WebCore::ScrollbarOrientation orientation, |
| 103 WebCore::ScrollbarControlSize size); | 103 WebCore::ScrollbarControlSize size); |
| 104 | 104 |
| 105 void initialize(WebCore::HTMLInputElement*, | 105 void initialize(WebCore::HTMLInputElement*, |
| 106 const WebVector<WebString>& names, | 106 const WebVector<WebString>& names, |
| 107 const WebVector<WebString>& labels, | 107 const WebVector<WebString>& labels, |
| 108 const WebVector<WebString>& icons, | 108 const WebVector<WebString>& icons, |
| 109 const WebVector<int>& uniqueIDs, | 109 const WebVector<int>& itemIDs); |
| 110 int separatorIndex); | |
| 111 | 110 |
| 112 void setSuggestions(const WebVector<WebString>& names, | 111 void setSuggestions(const WebVector<WebString>& names, |
| 113 const WebVector<WebString>& labels, | 112 const WebVector<WebString>& labels, |
| 114 const WebVector<WebString>& icons, | 113 const WebVector<WebString>& icons, |
| 115 const WebVector<int>& uniqueIDs, | 114 const WebVector<int>& itemIDs); |
| 116 int separatorIndex); | |
| 117 | 115 |
| 118 private: | 116 private: |
| 119 // Convert the specified index from an index into the visible list (which mi
ght | |
| 120 // include a separator entry) to an index to |m_names| and |m_labels|. | |
| 121 // Returns -1 if the given index points to the separator. | |
| 122 int convertListIndexToInternalIndex(unsigned) const; | |
| 123 WebViewImpl* getWebView() const; | 117 WebViewImpl* getWebView() const; |
| 124 WebCore::HTMLInputElement* getTextField() const { return m_textField.get();
} | 118 WebCore::HTMLInputElement* getTextField() const { return m_textField.get();
} |
| 125 WebCore::RenderStyle* textFieldStyle() const; | 119 WebCore::RenderStyle* textFieldStyle() const; |
| 126 | 120 |
| 127 int getSelectedIndex() const { return m_selectedIndex; } | 121 int getSelectedIndex() const { return m_selectedIndex; } |
| 128 void setSelectedIndex(int index) { m_selectedIndex = index; } | 122 void setSelectedIndex(int index) { m_selectedIndex = index; } |
| 129 | 123 |
| 130 bool itemIsWarning(unsigned listIndex) const; | 124 bool itemIsWarning(unsigned listIndex) const; |
| 131 | 125 |
| 132 // The names, labels and icons that make up the contents of the menu items. | 126 // The names, labels and icons that make up the contents of the menu items. |
| 133 Vector<WTF::String> m_names; | 127 Vector<WTF::String> m_names; |
| 134 Vector<WTF::String> m_labels; | 128 Vector<WTF::String> m_labels; |
| 135 Vector<WTF::String> m_icons; | 129 Vector<WTF::String> m_icons; |
| 136 Vector<int> m_uniqueIDs; | 130 Vector<int> m_itemIDs; |
| 137 | |
| 138 // The index of the separator. -1 if there is no separator. | |
| 139 int m_separatorIndex; | |
| 140 | 131 |
| 141 // The index of the selected item. -1 if there is no selected item. | 132 // The index of the selected item. -1 if there is no selected item. |
| 142 int m_selectedIndex; | 133 int m_selectedIndex; |
| 143 | 134 |
| 144 RefPtr<WebCore::HTMLInputElement> m_textField; | 135 RefPtr<WebCore::HTMLInputElement> m_textField; |
| 145 OwnPtr<WebCore::PopupMenuStyle> m_regularStyle; | 136 OwnPtr<WebCore::PopupMenuStyle> m_regularStyle; |
| 146 OwnPtr<WebCore::PopupMenuStyle> m_warningStyle; | 137 OwnPtr<WebCore::PopupMenuStyle> m_warningStyle; |
| 147 }; | 138 }; |
| 148 | 139 |
| 149 } // namespace WebKit | 140 } // namespace WebKit |
| 150 | 141 |
| 151 #endif | 142 #endif |
| OLD | NEW |