15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/* 25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2011 Google Inc. All rights reserved. 35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without 55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions 65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * are met: 75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1. Redistributions of source code must retain the above copyright 95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer. 105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright 115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer in the 125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * documentation and/or other materials provided with the distribution. 135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */ 255267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) 26926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#ifndef ColorChooserPopupUIController_h 27926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#define ColorChooserPopupUIController_h 285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 2953e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/page/PagePopupClient.h" 30f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "web/ColorChooserUIController.h" 31591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch#include "wtf/OwnPtr.h" 32926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 33c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink { 345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 356f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdochclass ChromeClientImpl; 369e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles)class ColorChooserClient; 379e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles)class PagePopup; 386f543c786fc42989f552b4daa774ca5ff32fa697Ben Murdoch 399e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles)class ColorChooserPopupUIController FINAL : public ColorChooserUIController, public PagePopupClient { 405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)public: 429e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) ColorChooserPopupUIController(LocalFrame*, ChromeClientImpl*, ColorChooserClient*); 43926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual ~ColorChooserPopupUIController(); 445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 45926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) // ColorChooserUIController functions: 46926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual void openUI() OVERRIDE; 475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 48926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) // ColorChooser functions 497242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci virtual void endChooser() OVERRIDE; 507242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci virtual AXObject* rootAXObject() OVERRIDE; 51926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 52926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) // PagePopupClient functions: 539e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) virtual IntSize contentSize() OVERRIDE; 549e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) virtual void writeDocument(SharedBuffer*) OVERRIDE; 559e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) virtual Locale& locale() OVERRIDE; 56926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual void setValueAndClosePopup(int, const String&) OVERRIDE; 57926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual void setValue(const String&) OVERRIDE; 58926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual void closePopup() OVERRIDE; 597242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci virtual Element& ownerElement() OVERRIDE; 60926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) virtual void didClosePopup() OVERRIDE; 615c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)private: 63926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) void openPopup(); 645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 65926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) ChromeClientImpl* m_chromeClient; 669e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) ColorChooserClient* m_client; 679e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) PagePopup* m_popup; 689e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) Locale& m_locale; 695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}; 709e12abdf8c3a23d52091ea54ebb6a04d327f9300Torne (Richard Coles) 71926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 73926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#endif // ColorChooserPopupUIController_h 74