Chromium Code Reviews| 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 CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 // expected to send back a JSON file as a return value. | 33 // expected to send back a JSON file as a return value. |
| 34 // | 34 // |
| 35 //////////////////////////////////////////////////////////////////////////////// | 35 //////////////////////////////////////////////////////////////////////////////// |
| 36 // | 36 // |
| 37 // TODO(akalin): Make WebDialogView contain an WebDialogWebContentsDelegate | 37 // TODO(akalin): Make WebDialogView contain an WebDialogWebContentsDelegate |
| 38 // instead of inheriting from it to avoid violating the "no multiple | 38 // instead of inheriting from it to avoid violating the "no multiple |
| 39 // inheritance" rule. | 39 // inheritance" rule. |
| 40 class WebDialogView : public views::ClientView, | 40 class WebDialogView : public views::ClientView, |
| 41 public WebDialogWebContentsDelegate, | 41 public WebDialogWebContentsDelegate, |
| 42 public ui::WebDialogDelegate, | 42 public ui::WebDialogDelegate, |
| 43 public views::WidgetDelegate { | 43 public views::WidgetDelegateView { |
|
Ben Goodger (Google)
2012/07/23 21:17:55
wrong
| |
| 44 public: | 44 public: |
| 45 WebDialogView(content::BrowserContext* context, | 45 WebDialogView(content::BrowserContext* context, |
| 46 ui::WebDialogDelegate* delegate); | 46 ui::WebDialogDelegate* delegate); |
| 47 virtual ~WebDialogView(); | 47 virtual ~WebDialogView(); |
| 48 | 48 |
| 49 // For testing. | 49 // For testing. |
| 50 content::WebContents* web_contents(); | 50 content::WebContents* web_contents(); |
| 51 | 51 |
| 52 // Overridden from views::ClientView: | 52 // Overridden from views::ClientView: |
| 53 virtual gfx::Size GetPreferredSize() OVERRIDE; | 53 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 54 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) | 54 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) |
| 55 OVERRIDE; | 55 OVERRIDE; |
| 56 virtual void ViewHierarchyChanged(bool is_add, | 56 virtual void ViewHierarchyChanged(bool is_add, |
| 57 views::View* parent, | 57 views::View* parent, |
| 58 views::View* child) OVERRIDE; | 58 views::View* child) OVERRIDE; |
| 59 virtual bool CanClose() OVERRIDE; | 59 virtual bool CanClose() OVERRIDE; |
| 60 | 60 |
| 61 // Overridden from views::WidgetDelegate: | 61 // Overridden from views::WidgetDelegateView: |
| 62 virtual bool CanResize() const OVERRIDE; | 62 virtual bool CanResize() const OVERRIDE; |
| 63 virtual ui::ModalType GetModalType() const OVERRIDE; | 63 virtual ui::ModalType GetModalType() const OVERRIDE; |
| 64 virtual string16 GetWindowTitle() const OVERRIDE; | 64 virtual string16 GetWindowTitle() const OVERRIDE; |
| 65 virtual std::string GetWindowName() const OVERRIDE; | 65 virtual std::string GetWindowName() const OVERRIDE; |
| 66 virtual void WindowClosing() OVERRIDE; | 66 virtual void WindowClosing() OVERRIDE; |
| 67 virtual views::View* GetContentsView() OVERRIDE; | 67 virtual views::View* GetContentsView() OVERRIDE; |
| 68 virtual ClientView* CreateClientView(views::Widget* widget) OVERRIDE; | 68 virtual ClientView* CreateClientView(views::Widget* widget) OVERRIDE; |
| 69 virtual views::View* GetInitiallyFocusedView() OVERRIDE; | 69 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
| 70 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 70 virtual bool ShouldShowWindowTitle() const OVERRIDE; |
| 71 virtual views::Widget* GetWidget() OVERRIDE; | |
| 72 virtual const views::Widget* GetWidget() const OVERRIDE; | |
| 73 | 71 |
| 74 // Overridden from ui::WebDialogDelegate: | 72 // Overridden from ui::WebDialogDelegate: |
| 75 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | 73 virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
| 76 virtual string16 GetDialogTitle() const OVERRIDE; | 74 virtual string16 GetDialogTitle() const OVERRIDE; |
| 77 virtual GURL GetDialogContentURL() const OVERRIDE; | 75 virtual GURL GetDialogContentURL() const OVERRIDE; |
| 78 virtual void GetWebUIMessageHandlers( | 76 virtual void GetWebUIMessageHandlers( |
| 79 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | 77 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
| 80 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 78 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
| 81 virtual void GetMinimumDialogSize(gfx::Size* size) const OVERRIDE; | 79 virtual void GetMinimumDialogSize(gfx::Size* size) const OVERRIDE; |
| 82 virtual std::string GetDialogArgs() const OVERRIDE; | 80 virtual std::string GetDialogArgs() const OVERRIDE; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 // closing) we delegate to the creator of this view, which we keep track of | 120 // closing) we delegate to the creator of this view, which we keep track of |
| 123 // using this variable. | 121 // using this variable. |
| 124 ui::WebDialogDelegate* delegate_; | 122 ui::WebDialogDelegate* delegate_; |
| 125 | 123 |
| 126 views::WebView* web_view_; | 124 views::WebView* web_view_; |
| 127 | 125 |
| 128 DISALLOW_COPY_AND_ASSIGN(WebDialogView); | 126 DISALLOW_COPY_AND_ASSIGN(WebDialogView); |
| 129 }; | 127 }; |
| 130 | 128 |
| 131 #endif // CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ | 129 #endif // CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ |
| OLD | NEW |