Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: Source/core/html/forms/PopupMenuClient.h

Issue 1267113002: PopupMenuImpl should get menu items via PopupMenuClient. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/layout/LayoutMenuList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 15 matching lines...) Expand all
26 #include "platform/LayoutUnit.h" 26 #include "platform/LayoutUnit.h"
27 #include "platform/PlatformExport.h" 27 #include "platform/PlatformExport.h"
28 #include "platform/geometry/IntRect.h" 28 #include "platform/geometry/IntRect.h"
29 #include "wtf/Forward.h" 29 #include "wtf/Forward.h"
30 30
31 namespace blink { 31 namespace blink {
32 32
33 class Element; 33 class Element;
34 class ComputedStyle; 34 class ComputedStyle;
35 35
36 // TODO(tkent): Remove this interface. crbug.com/515013.
36 class CORE_EXPORT PopupMenuClient { 37 class CORE_EXPORT PopupMenuClient {
37 public: 38 public:
38 virtual ~PopupMenuClient() { } 39 virtual ~PopupMenuClient() { }
39 virtual void valueChanged(unsigned listIndex, bool fireEvents = true) = 0; 40 virtual void valueChanged(unsigned listIndex, bool fireEvents = true) = 0;
40 virtual void selectionChanged(unsigned listIndex, bool fireEvents = true) = 0; 41 virtual void selectionChanged(unsigned listIndex, bool fireEvents = true) = 0;
41 virtual void selectionCleared() = 0; 42 virtual void selectionCleared() = 0;
42 43
43 // TODO(tkent): Introduce itemElement(), and remove itemFoo() functions. 44 virtual Element& itemElement(unsigned listIndex) const = 0;
45 // TODO(tkent): Remove itemFoo() functions. Use itemElement() instead.
44 virtual String itemText(unsigned listIndex) const = 0; 46 virtual String itemText(unsigned listIndex) const = 0;
45 virtual String itemToolTip(unsigned listIndex) const = 0; 47 virtual String itemToolTip(unsigned listIndex) const = 0;
46 virtual String itemAccessibilityText(unsigned listIndex) const = 0; 48 virtual String itemAccessibilityText(unsigned listIndex) const = 0;
47 virtual bool itemIsEnabled(unsigned listIndex) const = 0; 49 virtual bool itemIsEnabled(unsigned listIndex) const = 0;
48 virtual bool itemIsDisplayNone(unsigned listIndex) const = 0; 50 virtual bool itemIsDisplayNone(unsigned listIndex) const = 0;
49 virtual LayoutUnit clientPaddingLeft() const = 0; 51 virtual LayoutUnit clientPaddingLeft() const = 0;
50 virtual LayoutUnit clientPaddingRight() const = 0; 52 virtual LayoutUnit clientPaddingRight() const = 0;
51 virtual int listSize() const = 0; 53 virtual int listSize() const = 0;
52 virtual int selectedIndex() const = 0; 54 virtual int selectedIndex() const = 0;
53 virtual void popupDidHide() = 0; 55 virtual void popupDidHide() = 0;
54 // A popup is canceled when the popup was hidden without selecting an item. 56 // A popup is canceled when the popup was hidden without selecting an item.
55 virtual void popupDidCancel() = 0; 57 virtual void popupDidCancel() = 0;
56 virtual bool itemIsSeparator(unsigned listIndex) const = 0; 58 virtual bool itemIsSeparator(unsigned listIndex) const = 0;
57 virtual bool itemIsLabel(unsigned listIndex) const = 0; 59 virtual bool itemIsLabel(unsigned listIndex) const = 0;
58 virtual bool itemIsSelected(unsigned listIndex) const = 0; 60 virtual bool itemIsSelected(unsigned listIndex) const = 0;
59 // Provisional selection is a selection made using arrow keys or type ahead. 61 // Provisional selection is a selection made using arrow keys or type ahead.
60 virtual void provisionalSelectionChanged(unsigned) = 0; 62 virtual void provisionalSelectionChanged(unsigned) = 0;
61 virtual IntRect elementRectRelativeToViewport() const = 0; 63 virtual IntRect elementRectRelativeToViewport() const = 0;
62 virtual Element& ownerElement() const = 0; 64 virtual Element& ownerElement() const = 0;
63 // computedStyleForItem() returns nullptr only if the owner Document is not 65 // computedStyleForItem() returns nullptr only if the owner Document is not
64 // active. So, It returns a valid object when we open a popup. 66 // active. So, It returns a valid object when we open a popup.
65 virtual const ComputedStyle* computedStyleForItem(Element&) const = 0;
66 virtual const ComputedStyle* computedStyleForItem(unsigned listIndex) const = 0; 67 virtual const ComputedStyle* computedStyleForItem(unsigned listIndex) const = 0;
67 68
68 virtual void listBoxSelectItem(int /*listIndex*/, bool /*allowMultiplySelect ions*/, bool /*shift*/, bool /*fireOnChangeNow*/ = true) { ASSERT_NOT_REACHED(); } 69 virtual void listBoxSelectItem(int /*listIndex*/, bool /*allowMultiplySelect ions*/, bool /*shift*/, bool /*fireOnChangeNow*/ = true) { ASSERT_NOT_REACHED(); }
69 virtual bool multiple() const 70 virtual bool multiple() const
70 { 71 {
71 ASSERT_NOT_REACHED(); 72 ASSERT_NOT_REACHED();
72 return false; 73 return false;
73 } 74 }
74 }; 75 };
75 76
76 } 77 }
77 78
78 #endif 79 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/LayoutMenuList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698