| 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" | |
| 36 | 35 |
| 37 namespace blink { | 36 namespace blink { |
| 38 | 37 |
| 39 | 38 |
| 40 ColorChooserUIController::ColorChooserUIController(LocalFrame* frame, ColorChoos
erClient* client) | 39 ColorChooserUIController::ColorChooserUIController(LocalFrame* frame, ColorChoos
erClient* client) |
| 41 : m_client(client) | 40 : m_client(client) |
| 42 , m_frame(frame) | 41 , m_frame(frame) |
| 43 { | 42 { |
| 44 } | 43 } |
| 45 | 44 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 m_client->didEndChooser(); | 91 m_client->didEndChooser(); |
| 93 } | 92 } |
| 94 | 93 |
| 95 void ColorChooserUIController::openColorChooser() | 94 void ColorChooserUIController::openColorChooser() |
| 96 { | 95 { |
| 97 DCHECK(!m_chooser); | 96 DCHECK(!m_chooser); |
| 98 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(m_frame); | 97 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(m_frame); |
| 99 WebFrameClient* webFrameClient = frame->client(); | 98 WebFrameClient* webFrameClient = frame->client(); |
| 100 if (!webFrameClient) | 99 if (!webFrameClient) |
| 101 return; | 100 return; |
| 102 m_chooser = wrapUnique(webFrameClient->createColorChooser( | 101 m_chooser = adoptPtr(webFrameClient->createColorChooser( |
| 103 this, static_cast<WebColor>(m_client->currentColor().rgb()), m_client->s
uggestions())); | 102 this, static_cast<WebColor>(m_client->currentColor().rgb()), m_client->s
uggestions())); |
| 104 } | 103 } |
| 105 | 104 |
| 106 } // namespace blink | 105 } // namespace blink |
| OLD | NEW |