OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #include "web/ColorChooserUIController.h" | 26 #include "web/ColorChooserUIController.h" |
27 | 27 |
28 #include "core/html/forms/ColorChooserClient.h" | 28 #include "core/html/forms/ColorChooserClient.h" |
29 #include "platform/graphics/Color.h" | 29 #include "platform/graphics/Color.h" |
30 #include "public/platform/WebColor.h" | 30 #include "public/platform/WebColor.h" |
31 #include "public/web/WebColorChooser.h" | 31 #include "public/web/WebColorChooser.h" |
32 #include "public/web/WebColorSuggestion.h" | 32 #include "public/web/WebColorSuggestion.h" |
33 #include "public/web/WebFrameClient.h" | 33 #include "public/web/WebFrameClient.h" |
34 #include "web/WebLocalFrameImpl.h" | 34 #include "web/WebLocalFrameImpl.h" |
| 35 #include "wtf/PtrUtil.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 | 39 |
39 ColorChooserUIController::ColorChooserUIController(LocalFrame* frame, ColorChoos
erClient* client) | 40 ColorChooserUIController::ColorChooserUIController(LocalFrame* frame, ColorChoos
erClient* client) |
40 : m_client(client) | 41 : m_client(client) |
41 , m_frame(frame) | 42 , m_frame(frame) |
42 { | 43 { |
43 } | 44 } |
44 | 45 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 m_client->didEndChooser(); | 92 m_client->didEndChooser(); |
92 } | 93 } |
93 | 94 |
94 void ColorChooserUIController::openColorChooser() | 95 void ColorChooserUIController::openColorChooser() |
95 { | 96 { |
96 DCHECK(!m_chooser); | 97 DCHECK(!m_chooser); |
97 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(m_frame); | 98 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(m_frame); |
98 WebFrameClient* webFrameClient = frame->client(); | 99 WebFrameClient* webFrameClient = frame->client(); |
99 if (!webFrameClient) | 100 if (!webFrameClient) |
100 return; | 101 return; |
101 m_chooser = adoptPtr(webFrameClient->createColorChooser( | 102 m_chooser = wrapUnique(webFrameClient->createColorChooser( |
102 this, static_cast<WebColor>(m_client->currentColor().rgb()), m_client->s
uggestions())); | 103 this, static_cast<WebColor>(m_client->currentColor().rgb()), m_client->s
uggestions())); |
103 } | 104 } |
104 | 105 |
105 } // namespace blink | 106 } // namespace blink |
OLD | NEW |