| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 setValue(stringValue); | 127 setValue(stringValue); |
| 128 if (numValue == ColorPickerPopupActionChooseOtherColor) | 128 if (numValue == ColorPickerPopupActionChooseOtherColor) |
| 129 openColorChooser(); | 129 openColorChooser(); |
| 130 closePopup(); | 130 closePopup(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void ColorChooserPopupUIController::setValue(const String& value) { | 133 void ColorChooserPopupUIController::setValue(const String& value) { |
| 134 DCHECK(m_client); | 134 DCHECK(m_client); |
| 135 Color color; | 135 Color color; |
| 136 bool success = color.setFromString(value); | 136 bool success = color.setFromString(value); |
| 137 ASSERT_UNUSED(success, success); | 137 DCHECK(success); |
| 138 m_client->didChooseColor(color); | 138 m_client->didChooseColor(color); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ColorChooserPopupUIController::didClosePopup() { | 141 void ColorChooserPopupUIController::didClosePopup() { |
| 142 m_popup = nullptr; | 142 m_popup = nullptr; |
| 143 | 143 |
| 144 if (!m_chooser) | 144 if (!m_chooser) |
| 145 didEndChooser(); | 145 didEndChooser(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 Element& ColorChooserPopupUIController::ownerElement() { | 148 Element& ColorChooserPopupUIController::ownerElement() { |
| 149 return m_client->ownerElement(); | 149 return m_client->ownerElement(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ColorChooserPopupUIController::openPopup() { | 152 void ColorChooserPopupUIController::openPopup() { |
| 153 DCHECK(!m_popup); | 153 DCHECK(!m_popup); |
| 154 m_popup = m_chromeClient->openPagePopup(this); | 154 m_popup = m_chromeClient->openPagePopup(this); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void ColorChooserPopupUIController::closePopup() { | 157 void ColorChooserPopupUIController::closePopup() { |
| 158 if (!m_popup) | 158 if (!m_popup) |
| 159 return; | 159 return; |
| 160 m_chromeClient->closePagePopup(m_popup); | 160 m_chromeClient->closePagePopup(m_popup); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace blink | 163 } // namespace blink |
| OLD | NEW |