| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ | 5 #ifndef ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ |
| 6 #define ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ | 6 #define ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ash/content_support/ash_with_content_export.h" | 8 #include "ash/content_support/ash_with_content_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Delegate to handle showing the keyboard overlay drawing. Exported for test. | 22 // Delegate to handle showing the keyboard overlay drawing. Exported for test. |
| 23 class ASH_WITH_CONTENT_EXPORT KeyboardOverlayDelegate | 23 class ASH_WITH_CONTENT_EXPORT KeyboardOverlayDelegate |
| 24 : public ui::WebDialogDelegate { | 24 : public ui::WebDialogDelegate { |
| 25 public: | 25 public: |
| 26 KeyboardOverlayDelegate(const base::string16& title, const GURL& url); | 26 KeyboardOverlayDelegate(const base::string16& title, const GURL& url); |
| 27 | 27 |
| 28 // Shows the keyboard overlay widget. Returns the widget for testing. | 28 // Shows the keyboard overlay widget. Returns the widget for testing. |
| 29 views::Widget* Show(views::WebDialogView* view); | 29 views::Widget* Show(views::WebDialogView* view); |
| 30 | 30 |
| 31 // Overridden from ui::WebDialogDelegate: | 31 // Overridden from ui::WebDialogDelegate: |
| 32 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 32 virtual void GetDialogSize(gfx::Size* size) const override; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 FRIEND_TEST_ALL_PREFIXES(KeyboardOverlayDelegateTest, ShowAndClose); | 35 FRIEND_TEST_ALL_PREFIXES(KeyboardOverlayDelegateTest, ShowAndClose); |
| 36 | 36 |
| 37 virtual ~KeyboardOverlayDelegate(); | 37 virtual ~KeyboardOverlayDelegate(); |
| 38 | 38 |
| 39 // Overridden from ui::WebDialogDelegate: | 39 // Overridden from ui::WebDialogDelegate: |
| 40 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | 40 virtual ui::ModalType GetDialogModalType() const override; |
| 41 virtual base::string16 GetDialogTitle() const OVERRIDE; | 41 virtual base::string16 GetDialogTitle() const override; |
| 42 virtual GURL GetDialogContentURL() const OVERRIDE; | 42 virtual GURL GetDialogContentURL() const override; |
| 43 virtual void GetWebUIMessageHandlers( | 43 virtual void GetWebUIMessageHandlers( |
| 44 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | 44 std::vector<content::WebUIMessageHandler*>* handlers) const override; |
| 45 virtual std::string GetDialogArgs() const OVERRIDE; | 45 virtual std::string GetDialogArgs() const override; |
| 46 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 46 virtual void OnDialogClosed(const std::string& json_retval) override; |
| 47 virtual void OnCloseContents(content::WebContents* source, | 47 virtual void OnCloseContents(content::WebContents* source, |
| 48 bool* out_close_dialog) OVERRIDE; | 48 bool* out_close_dialog) override; |
| 49 virtual bool ShouldShowDialogTitle() const OVERRIDE; | 49 virtual bool ShouldShowDialogTitle() const override; |
| 50 virtual bool HandleContextMenu( | 50 virtual bool HandleContextMenu( |
| 51 const content::ContextMenuParams& params) OVERRIDE; | 51 const content::ContextMenuParams& params) override; |
| 52 | 52 |
| 53 // The dialog title. | 53 // The dialog title. |
| 54 base::string16 title_; | 54 base::string16 title_; |
| 55 | 55 |
| 56 // The URL of the keyboard overlay. | 56 // The URL of the keyboard overlay. |
| 57 GURL url_; | 57 GURL url_; |
| 58 | 58 |
| 59 // The widget associated with this delegate. Not owned. | 59 // The widget associated with this delegate. Not owned. |
| 60 views::Widget* widget_; | 60 views::Widget* widget_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegate); | 62 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDelegate); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace ash | 65 } // namespace ash |
| 66 | 66 |
| 67 #endif // ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ | 67 #endif // ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_DELEGATE_H_ |
| OLD | NEW |