OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_WEB_DIALOGS_TEST_TEST_WEB_DIALOG_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_INLINE_LOGIN_DIALOG_H_ |
6 #define UI_WEB_DIALOGS_TEST_TEST_WEB_DIALOG_DELEGATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UI_INLINE_LOGIN_DIALOG_H_ |
7 | |
8 #include <string> | |
9 | 7 |
10 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
11 #include "ui/gfx/size.h" | 9 #include "base/macros.h" |
12 #include "ui/web_dialogs/web_dialog_delegate.h" | 10 #include "ui/web_dialogs/web_dialog_delegate.h" |
13 #include "url/gurl.h" | 11 |
12 namespace content { | |
13 class BrowserContext; | |
14 } | |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 namespace test { | |
17 | 17 |
18 class TestWebDialogDelegate : public WebDialogDelegate { | 18 class InlineLoginDialog : public ui::WebDialogDelegate { |
19 public: | 19 public: |
20 explicit TestWebDialogDelegate(const GURL& url); | 20 static void Show(content::BrowserContext* context); |
21 virtual ~TestWebDialogDelegate(); | |
22 | 21 |
23 void set_size(int width, int height) { | 22 private: |
24 size_.SetSize(width, height); | 23 InlineLoginDialog(); |
25 } | 24 virtual ~InlineLoginDialog(); |
26 | 25 |
27 // WebDialogDelegate implementation: | 26 // Overriden from WebDialogDelegate. |
28 virtual ModalType GetDialogModalType() const OVERRIDE; | 27 virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
Roger Tawa OOO till Jul 10th
2014/04/28 19:06:22
Why extra ui:: here and line 18 above if this is a
dzhioev (left Google)
2014/04/28 19:49:17
Done.
| |
29 virtual base::string16 GetDialogTitle() const OVERRIDE; | 28 virtual base::string16 GetDialogTitle() const OVERRIDE; |
30 virtual GURL GetDialogContentURL() const OVERRIDE; | 29 virtual GURL GetDialogContentURL() const OVERRIDE; |
31 virtual void GetWebUIMessageHandlers( | 30 virtual void GetWebUIMessageHandlers( |
32 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | 31 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
33 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 32 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
34 virtual std::string GetDialogArgs() const OVERRIDE; | 33 virtual std::string GetDialogArgs() const OVERRIDE; |
34 virtual bool CanResizeDialog() const OVERRIDE; | |
35 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 35 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
36 virtual void OnCloseContents(content::WebContents* source, | 36 virtual void OnCloseContents(content::WebContents* source, |
37 bool* out_close_dialog) OVERRIDE; | 37 bool* out_close_dialog) OVERRIDE; |
38 virtual bool ShouldShowDialogTitle() const OVERRIDE; | 38 virtual bool ShouldShowDialogTitle() const OVERRIDE; |
39 | 39 |
40 protected: | 40 DISALLOW_COPY_AND_ASSIGN(InlineLoginDialog); |
41 const GURL url_; | |
42 gfx::Size size_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(TestWebDialogDelegate); | |
45 }; | 41 }; |
46 | 42 |
47 } // namespace test | |
48 } // namespace ui | 43 } // namespace ui |
49 | 44 |
50 #endif // UI_WEB_DIALOGS_TEST_TEST_WEB_DIALOG_DELEGATE_H_ | 45 #endif // CHROME_BROWSER_CHROMEOS_UI_INLINE_LOGIN_DIALOG_H_ |
OLD | NEW |