| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 PagePopupClient::addString("</script></body>\n", data); | 118 PagePopupClient::addString("</script></body>\n", data); |
| 119 } | 119 } |
| 120 | 120 |
| 121 Locale& ColorChooserPopupUIController::locale() | 121 Locale& ColorChooserPopupUIController::locale() |
| 122 { | 122 { |
| 123 return m_locale; | 123 return m_locale; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ColorChooserPopupUIController::setValueAndClosePopup(int numValue, const St
ring& stringValue) | 126 void ColorChooserPopupUIController::setValueAndClosePopup(int numValue, const St
ring& stringValue) |
| 127 { | 127 { |
| 128 ASSERT(m_popup); | 128 DCHECK(m_popup); |
| 129 ASSERT(m_client); | 129 DCHECK(m_client); |
| 130 if (numValue == ColorPickerPopupActionSetValue) | 130 if (numValue == ColorPickerPopupActionSetValue) |
| 131 setValue(stringValue); | 131 setValue(stringValue); |
| 132 if (numValue == ColorPickerPopupActionChooseOtherColor) | 132 if (numValue == ColorPickerPopupActionChooseOtherColor) |
| 133 openColorChooser(); | 133 openColorChooser(); |
| 134 closePopup(); | 134 closePopup(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void ColorChooserPopupUIController::setValue(const String& value) | 137 void ColorChooserPopupUIController::setValue(const String& value) |
| 138 { | 138 { |
| 139 ASSERT(m_client); | 139 DCHECK(m_client); |
| 140 Color color; | 140 Color color; |
| 141 bool success = color.setFromString(value); | 141 bool success = color.setFromString(value); |
| 142 ASSERT_UNUSED(success, success); | 142 ASSERT_UNUSED(success, success); |
| 143 m_client->didChooseColor(color); | 143 m_client->didChooseColor(color); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void ColorChooserPopupUIController::didClosePopup() | 146 void ColorChooserPopupUIController::didClosePopup() |
| 147 { | 147 { |
| 148 m_popup = nullptr; | 148 m_popup = nullptr; |
| 149 | 149 |
| 150 if (!m_chooser) | 150 if (!m_chooser) |
| 151 didEndChooser(); | 151 didEndChooser(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 Element& ColorChooserPopupUIController::ownerElement() | 154 Element& ColorChooserPopupUIController::ownerElement() |
| 155 { | 155 { |
| 156 return m_client->ownerElement(); | 156 return m_client->ownerElement(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ColorChooserPopupUIController::openPopup() | 159 void ColorChooserPopupUIController::openPopup() |
| 160 { | 160 { |
| 161 ASSERT(!m_popup); | 161 DCHECK(!m_popup); |
| 162 m_popup = m_chromeClient->openPagePopup(this); | 162 m_popup = m_chromeClient->openPagePopup(this); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ColorChooserPopupUIController::closePopup() | 165 void ColorChooserPopupUIController::closePopup() |
| 166 { | 166 { |
| 167 if (!m_popup) | 167 if (!m_popup) |
| 168 return; | 168 return; |
| 169 m_chromeClient->closePagePopup(m_popup); | 169 m_chromeClient->closePagePopup(m_popup); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |