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

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

Issue 26434002: Cleanup: Add more conversion helpers for usage. (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
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 isPagePopup() 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->isPagePopup());
tkent 2013/10/08 05:24:04 should accept null widget for consistency.
141 return static_cast<WebPopupMenuImpl*>(widget);
142 }
143
144 inline WebPopupMenuImpl* toWebPopupMenuImpl(WebCore::FramelessScrollViewClient* client)
145 {
146 // We need not check for type of FramelessScrollViewClient, since WebPopupMe nuImpl
147 // is the only derived class from FramelessScrollViewClient.
148 ASSERT_WITH_SECURITY_IMPLICATION(client);
tkent 2013/10/08 05:24:04 null pointer has no security implication. should a
149 return static_cast<WebPopupMenuImpl*>(client);
150 }
151
137 } // namespace WebKit 152 } // namespace WebKit
138 153
139 #endif 154 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698