| 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 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/ui/webui/web_dialog_web_contents_delegate.h" | |
| 14 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 15 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
| 16 #include "ui/views/window/client_view.h" | 15 #include "ui/views/window/client_view.h" |
| 17 #include "ui/web_dialogs/web_dialog_delegate.h" | 16 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 17 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BrowserContext; | 20 class BrowserContext; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class WebView; | 24 class WebView; |
| 25 } | 25 } |
| 26 | 26 |
| 27 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
| 28 // | 28 // |
| 29 // WebDialogView is a view used to display an web dialog to the user. The | 29 // WebDialogView is a view used to display an web dialog to the user. The |
| 30 // content of the dialogs is determined by the delegate | 30 // content of the dialogs is determined by the delegate |
| 31 // (ui::WebDialogDelegate), but is basically a file URL along with a | 31 // (ui::WebDialogDelegate), but is basically a file URL along with a |
| 32 // JSON input string. The HTML is supposed to show a UI to the user and is | 32 // JSON input string. The HTML is supposed to show a UI to the user and is |
| 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 ui::WebDialogWebContentsDelegate, |
| 42 public ui::WebDialogDelegate, | 42 public ui::WebDialogDelegate, |
| 43 public views::WidgetDelegate { | 43 public views::WidgetDelegate { |
| 44 public: | 44 public: |
| 45 // |handler| must not be NULL and this class takes the ownership. | 45 // |handler| must not be NULL and this class takes the ownership. |
| 46 WebDialogView(content::BrowserContext* context, | 46 WebDialogView(content::BrowserContext* context, |
| 47 ui::WebDialogDelegate* delegate, | 47 ui::WebDialogDelegate* delegate, |
| 48 WebContentsHandler* handler); | 48 WebContentsHandler* handler); |
| 49 virtual ~WebDialogView(); | 49 virtual ~WebDialogView(); |
| 50 | 50 |
| 51 // For testing. | 51 // For testing. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // closing) we delegate to the creator of this view, which we keep track of | 124 // closing) we delegate to the creator of this view, which we keep track of |
| 125 // using this variable. | 125 // using this variable. |
| 126 ui::WebDialogDelegate* delegate_; | 126 ui::WebDialogDelegate* delegate_; |
| 127 | 127 |
| 128 views::WebView* web_view_; | 128 views::WebView* web_view_; |
| 129 | 129 |
| 130 DISALLOW_COPY_AND_ASSIGN(WebDialogView); | 130 DISALLOW_COPY_AND_ASSIGN(WebDialogView); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 #endif // CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ | 133 #endif // CHROME_BROWSER_UI_VIEWS_WEB_DIALOG_VIEW_H_ |
| OLD | NEW |