Home | History | Annotate | Download | only in views
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DELEGATE_H_
      6 #define CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DELEGATE_H_
      7 
      8 #include "chrome/browser/ui/webui/html_dialog_ui.h"
      9 
     10 
     11 class HtmlDialogView;
     12 
     13 class KeyboardOverlayDelegate : public HtmlDialogUIDelegate {
     14  public:
     15   explicit KeyboardOverlayDelegate(const std::wstring& title);
     16 
     17   void set_view(HtmlDialogView* html_view) {
     18     view_ = html_view;
     19   }
     20 
     21   HtmlDialogView* view() {
     22     return view_;
     23   }
     24 
     25  private:
     26   ~KeyboardOverlayDelegate();
     27 
     28   // Overridden from HtmlDialogUI::Delegate:
     29   virtual bool IsDialogModal() const;
     30   virtual std::wstring GetDialogTitle() const;
     31   virtual GURL GetDialogContentURL() const;
     32   virtual void GetWebUIMessageHandlers(
     33       std::vector<WebUIMessageHandler*>* handlers) const;
     34   virtual void GetDialogSize(gfx::Size* size) const;
     35   virtual std::string GetDialogArgs() const;
     36   virtual void OnDialogClosed(const std::string& json_retval);
     37   virtual void OnCloseContents(TabContents* source, bool* out_close_dialog);
     38   virtual bool ShouldShowDialogTitle() const;
     39   virtual bool HandleContextMenu(const ContextMenuParams& params);
     40 
     41   // The dialog title.
     42   std::wstring title_;
     43 
     44   // The view associated with this delegate.
     45   // This class does not own the pointer.
     46   HtmlDialogView* view_;
     47 
     48   DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegate);
     49 };
     50 
     51 #endif  // CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DELEGATE_H_
     52