OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "web/PopupMenuImpl.h" | 5 #include "web/PopupMenuImpl.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/css/CSSFontSelector.h" | 8 #include "core/css/CSSFontSelector.h" |
9 #include "core/dom/ElementTraversal.h" | 9 #include "core/dom/ElementTraversal.h" |
10 #include "core/dom/NodeComputedStyle.h" | 10 #include "core/dom/NodeComputedStyle.h" |
11 #include "core/dom/StyleEngine.h" | 11 #include "core/dom/StyleEngine.h" |
12 #include "core/dom/TaskRunnerHelper.h" | 12 #include "core/dom/TaskRunnerHelper.h" |
13 #include "core/events/ScopedEventQueue.h" | 13 #include "core/events/ScopedEventQueue.h" |
14 #include "core/exported/WebViewBase.h" | 14 #include "core/exported/WebViewBase.h" |
15 #include "core/frame/FrameView.h" | 15 #include "core/frame/FrameView.h" |
16 #include "core/frame/LocalFrame.h" | 16 #include "core/frame/LocalFrame.h" |
17 #include "core/html/HTMLHRElement.h" | 17 #include "core/html/HTMLHRElement.h" |
18 #include "core/html/HTMLOptGroupElement.h" | 18 #include "core/html/HTMLOptGroupElement.h" |
19 #include "core/html/HTMLOptionElement.h" | 19 #include "core/html/HTMLOptionElement.h" |
20 #include "core/html/HTMLSelectElement.h" | 20 #include "core/html/HTMLSelectElement.h" |
21 #include "core/html/parser/HTMLParserIdioms.h" | 21 #include "core/html/parser/HTMLParserIdioms.h" |
22 #include "core/layout/LayoutTheme.h" | 22 #include "core/layout/LayoutTheme.h" |
| 23 #include "core/page/ChromeClient.h" |
23 #include "core/page/PagePopup.h" | 24 #include "core/page/PagePopup.h" |
24 #include "platform/geometry/IntRect.h" | 25 #include "platform/geometry/IntRect.h" |
25 #include "platform/text/PlatformLocale.h" | 26 #include "platform/text/PlatformLocale.h" |
26 #include "public/platform/Platform.h" | 27 #include "public/platform/Platform.h" |
27 #include "public/platform/WebMouseEvent.h" | 28 #include "public/platform/WebMouseEvent.h" |
28 #include "public/web/WebColorChooser.h" | 29 #include "public/web/WebColorChooser.h" |
29 #include "web/ChromeClientImpl.h" | |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 const char* FontWeightToString(FontWeight weight) { | 35 const char* FontWeightToString(FontWeight weight) { |
36 switch (weight) { | 36 switch (weight) { |
37 case kFontWeight100: | 37 case kFontWeight100: |
38 return "100"; | 38 return "100"; |
39 case kFontWeight200: | 39 case kFontWeight200: |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 Color background_color_; | 229 Color background_color_; |
230 const ComputedStyle* group_style_; | 230 const ComputedStyle* group_style_; |
231 | 231 |
232 unsigned list_index_; | 232 unsigned list_index_; |
233 bool is_in_group_; | 233 bool is_in_group_; |
234 SharedBuffer* buffer_; | 234 SharedBuffer* buffer_; |
235 }; | 235 }; |
236 | 236 |
237 // ---------------------------------------------------------------- | 237 // ---------------------------------------------------------------- |
238 | 238 |
239 PopupMenuImpl* PopupMenuImpl::Create(ChromeClientImpl* chrome_client, | 239 PopupMenuImpl* PopupMenuImpl::Create(ChromeClient* chrome_client, |
240 HTMLSelectElement& owner_element) { | 240 HTMLSelectElement& owner_element) { |
241 return new PopupMenuImpl(chrome_client, owner_element); | 241 return new PopupMenuImpl(chrome_client, owner_element); |
242 } | 242 } |
243 | 243 |
244 PopupMenuImpl::PopupMenuImpl(ChromeClientImpl* chrome_client, | 244 PopupMenuImpl::PopupMenuImpl(ChromeClient* chrome_client, |
245 HTMLSelectElement& owner_element) | 245 HTMLSelectElement& owner_element) |
246 : chrome_client_(chrome_client), | 246 : chrome_client_(chrome_client), |
247 owner_element_(owner_element), | 247 owner_element_(owner_element), |
248 popup_(nullptr), | 248 popup_(nullptr), |
249 needs_update_(false) {} | 249 needs_update_(false) {} |
250 | 250 |
251 PopupMenuImpl::~PopupMenuImpl() { | 251 PopupMenuImpl::~PopupMenuImpl() { |
252 DCHECK(!popup_); | 252 DCHECK(!popup_); |
253 } | 253 } |
254 | 254 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 } | 579 } |
580 | 580 |
581 void PopupMenuImpl::DisconnectClient() { | 581 void PopupMenuImpl::DisconnectClient() { |
582 owner_element_ = nullptr; | 582 owner_element_ = nullptr; |
583 // Cannot be done during finalization, so instead done when the | 583 // Cannot be done during finalization, so instead done when the |
584 // layout object is destroyed and disconnected. | 584 // layout object is destroyed and disconnected. |
585 Dispose(); | 585 Dispose(); |
586 } | 586 } |
587 | 587 |
588 } // namespace blink | 588 } // namespace blink |
OLD | NEW |