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

Side by Side Diff: Source/web/WebPopupMenuImpl.h

Issue 26564006: Cleanup: Add conversion interface for WebWidget derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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
« no previous file with comments | « Source/web/WebPagePopupImpl.h ('k') | Source/web/WebViewImpl.cpp » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const WebString& text, 79 const WebString& text,
80 const WebVector<WebCompositionUnderline>& underlines, 80 const WebVector<WebCompositionUnderline>& underlines,
81 int selectionStart, int selectionEnd) OVERRIDE; 81 int selectionStart, int selectionEnd) OVERRIDE;
82 virtual bool confirmComposition() OVERRIDE; 82 virtual bool confirmComposition() OVERRIDE;
83 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior ) OVERRIDE; 83 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior ) OVERRIDE;
84 virtual bool confirmComposition(const WebString& text) OVERRIDE; 84 virtual bool confirmComposition(const WebString& text) OVERRIDE;
85 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE; 85 virtual bool compositionRange(size_t* location, size_t* length) OVERRIDE;
86 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID E; 86 virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRID E;
87 virtual void setTextDirection(WebTextDirection) OVERRIDE; 87 virtual void setTextDirection(WebTextDirection) OVERRIDE;
88 virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false; } 88 virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false; }
89 virtual bool isPopupMenu() const OVERRIDE { return true; }
89 90
90 // WebPopupMenuImpl 91 // WebPopupMenuImpl
91 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds) ; 92 void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds) ;
92 93
93 WebWidgetClient* client() { return m_client; } 94 WebWidgetClient* client() { return m_client; }
94 95
95 void handleMouseMove(const WebMouseEvent&); 96 void handleMouseMove(const WebMouseEvent&);
96 void handleMouseLeave(const WebMouseEvent&); 97 void handleMouseLeave(const WebMouseEvent&);
97 void handleMouseDown(const WebMouseEvent&); 98 void handleMouseDown(const WebMouseEvent&);
98 void handleMouseUp(const WebMouseEvent&); 99 void handleMouseUp(const WebMouseEvent&);
(...skipping 28 matching lines...) Expand all
127 WebWidgetClient* m_client; 128 WebWidgetClient* m_client;
128 WebSize m_size; 129 WebSize m_size;
129 130
130 WebPoint m_lastMousePosition; 131 WebPoint m_lastMousePosition;
131 132
132 // This is a non-owning ref. The popup will notify us via popupClosed() 133 // This is a non-owning ref. The popup will notify us via popupClosed()
133 // before it is destroyed. 134 // before it is destroyed.
134 WebCore::FramelessScrollView* m_widget; 135 WebCore::FramelessScrollView* m_widget;
135 }; 136 };
136 137
138 inline WebPopupMenuImpl* toWebPopupMenuImpl(WebWidget* widget)
139 {
140 ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isPopupMenu());
141 return static_cast<WebPopupMenuImpl*>(widget);
142 }
143
144 inline WebPopupMenuImpl* toWebPopupMenuImpl(WebCore::FramelessScrollViewClient* client)
145 {
146 // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient,
147 // so no need for further checking.
148 return static_cast<WebPopupMenuImpl*>(client);
149 }
150
137 } // namespace WebKit 151 } // namespace WebKit
138 152
139 #endif 153 #endif
OLDNEW
« no previous file with comments | « Source/web/WebPagePopupImpl.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698