*/
#include "config.h"
-#include "ColorChooserPopupUIController.h"
+#include "web/ColorChooserPopupUIController.h"
-#include "ChromeClientImpl.h"
-#include "ColorSuggestionPicker.h"
-#include "PickerCommon.h"
-#include "WebColorChooser.h"
-#include "WebViewImpl.h"
#include "core/frame/FrameView.h"
-#include "platform/ColorChooserClient.h"
+#include "core/html/forms/ColorChooserClient.h"
+#include "core/page/PagePopup.h"
#include "platform/geometry/IntRect.h"
-
-using namespace WebCore;
+#include "public/platform/Platform.h"
+#include "public/web/WebColorChooser.h"
+#include "web/ChromeClientImpl.h"
+#include "web/WebViewImpl.h"
namespace blink {
ColorPickerPopupActionSetValue = 0
};
-ColorChooserPopupUIController::ColorChooserPopupUIController(ChromeClientImpl* chromeClient, ColorChooserClient* client)
- : ColorChooserUIController(chromeClient, client)
+ColorChooserPopupUIController::ColorChooserPopupUIController(LocalFrame* frame, ChromeClientImpl* chromeClient, ColorChooserClient* client)
+ : ColorChooserUIController(frame, client)
, m_chromeClient(chromeClient)
- , m_client(client)
, m_popup(0)
, m_locale(Locale::defaultLocale())
{
ColorChooserPopupUIController::~ColorChooserPopupUIController()
{
+ closePopup();
+ // ~ColorChooserUIController ends the ColorChooser.
}
void ColorChooserPopupUIController::openUI()
{
if (m_chooser)
m_chooser->endChooser();
- if (m_popup)
- closePopup();
+
+ closePopup();
+}
+
+AXObject* ColorChooserPopupUIController::rootAXObject()
+{
+ return m_popup ? m_popup->rootAXObject() : 0;
}
IntSize ColorChooserPopupUIController::contentSize()
IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elementRectRelativeToRootView());
PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", data);
- data->append(pickerCommonCss, sizeof(pickerCommonCss));
- data->append(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss));
+ data->append(Platform::current()->loadResource("pickerCommon.css"));
+ data->append(Platform::current()->loadResource("colorSuggestionPicker.css"));
PagePopupClient::addString("</style></head><body><div id=main>Loading...</div><script>\n"
"window.dialogArguments = {\n", data);
PagePopupClient::addProperty("values", suggestionValues, data);
PagePopupClient::addProperty("otherColorLabel", locale().queryString(WebLocalizedString::OtherColorLabel), data);
addProperty("anchorRectInScreen", anchorRectInScreen, data);
PagePopupClient::addString("};\n", data);
- data->append(pickerCommonJs, sizeof(pickerCommonJs));
- data->append(colorSuggestionPickerJs, sizeof(colorSuggestionPickerJs));
+ data->append(Platform::current()->loadResource("pickerCommon.js"));
+ data->append(Platform::current()->loadResource("colorSuggestionPicker.js"));
PagePopupClient::addString("</script></body>\n", data);
}
didEndChooser();
}
+Element& ColorChooserPopupUIController::ownerElement()
+{
+ return m_client->ownerElement();
+}
void ColorChooserPopupUIController::openPopup()
{
m_chromeClient->closePagePopup(m_popup);
}
-}
+} // namespace blink