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

Side by Side Diff: webkit/port/platform/chromium/PopupMenuChromium.h

Issue 8885: Implementation of the UI part of the autofill (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PopupMenuChromium_h
6 #define PopupMenuChromium_h
7
8 #pragma warning(push, 0)
9 #include "PopupMenuClient.h"
10
11 #include "FramelessScrollView.h"
12 #include "IntRect.h"
13 #pragma warning(pop)
14
15
16 namespace WebCore {
17
18 class PopupListBox;
19
20 // TODO(darin): Our FramelessScrollView classes need to implement HostWindow!
21
22 // This class holds a PopupListBox (see cpp file). Its sole purpose is to be
23 // able to draw a border around its child. All its paint/event handling is just
24 // forwarded to the child listBox (with the appropriate transforms).
25 // NOTE: this class is exposed so it can be instantiated direcly for the
26 // autofill popup. We cannot use the Popup class directly in that case as the
27 // autofill popup should not be focused when shown and we want to forward the
28 // key events to it (through handleKeyEvent).
29
30 class PopupContainer : public FramelessScrollView, public RefCounted<PopupContai ner> {
31 public:
32 static PassRefPtr<PopupContainer> create(PopupMenuClient* client,
33 bool focusOnShow);
34
35 // Whether a key event should be sent to this popup.
36 virtual bool isInterestedInEventForKey(int key_code);
37
38 // FramelessScrollView
39 virtual void paint(GraphicsContext* gc, const IntRect& rect);
40 virtual void hide();
41 virtual bool handleMouseDownEvent(const PlatformMouseEvent& event);
42 virtual bool handleMouseMoveEvent(const PlatformMouseEvent& event);
43 virtual bool handleMouseReleaseEvent(const PlatformMouseEvent& event);
44 virtual bool handleWheelEvent(const PlatformWheelEvent& event);
45 virtual bool handleKeyEvent(const PlatformKeyboardEvent& event);
46
47 // PopupContainer methods
48
49 // Show the popup
50 void showPopup(FrameView* view);
51
52 // Show the popup in the specified rect for the specified frame.
53 // Note: this code was somehow arbitrarily factored-out of the Popup class
54 // so WebViewImpl can create a PopupContainer.
55 void show(const IntRect& r, FrameView* v, int index);
56
57 // Hide the popup. Do not call this directly: use client->hidePopup().
58 void hidePopup();
59
60 // Compute size of widget and children.
61 void layout();
62
63 PopupListBox* listBox() const { return m_listBox.get(); }
64
65 private:
66 friend class WTF::RefCounted<PopupContainer>;
67
68 PopupContainer(PopupMenuClient* client, bool focusOnShow);
69 ~PopupContainer();
70
71 // Paint the border.
72 void paintBorder(GraphicsContext* gc, const IntRect& rect);
73
74 RefPtr<PopupListBox> m_listBox;
75
76 // Whether the window showing this popup should be focused when shown.
77 bool m_focusOnShow;
78 };
79
80 }
81
82 #endif // PopupMenuChromium_h
OLDNEW
« no previous file with comments | « webkit/port/page/chromium/ChromeClientChromium.h ('k') | webkit/port/platform/chromium/PopupMenuChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698