OLD | NEW |
---|---|
1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/web_dialogs/web_dialog_delegate.h" | 14 #include "ui/web_dialogs/web_dialog_delegate.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 // Set Time dialog for setting the system time, date and time zone. | 18 // Set Time dialog for setting the system time, date and time zone. |
19 class SetTimeDialog : public ui::WebDialogDelegate { | 19 class SetTimeDialog : public ui::WebDialogDelegate { |
20 public: | 20 public: |
21 // Shows the dialog as a child of |parent|, for example the webui settings | |
22 // window. | |
23 static void ShowDialogInParent(gfx::NativeWindow parent); | |
24 | |
25 // Shows the dialog in a given container, for example at the login screen | |
26 // where the general settings window is not available. | |
27 static void ShowDialogInContainer(int container_id); | |
sky
2016/10/21 23:11:15
Document what container_id is/means? I suspect som
James Cook
2016/10/21 23:28:13
Done.
| |
28 | |
29 private: | |
21 SetTimeDialog(); | 30 SetTimeDialog(); |
22 ~SetTimeDialog() override; | 31 ~SetTimeDialog() override; |
23 | 32 |
24 static void ShowDialog(gfx::NativeWindow owning_window); | 33 static void ShowDialogImpl(gfx::NativeWindow parent, int container_id); |
25 | 34 |
26 private: | |
27 // ui::WebDialogDelegate: | 35 // ui::WebDialogDelegate: |
28 ui::ModalType GetDialogModalType() const override; | 36 ui::ModalType GetDialogModalType() const override; |
29 base::string16 GetDialogTitle() const override; | 37 base::string16 GetDialogTitle() const override; |
30 GURL GetDialogContentURL() const override; | 38 GURL GetDialogContentURL() const override; |
31 void GetWebUIMessageHandlers( | 39 void GetWebUIMessageHandlers( |
32 std::vector<content::WebUIMessageHandler*>* handlers) const override; | 40 std::vector<content::WebUIMessageHandler*>* handlers) const override; |
33 void GetDialogSize(gfx::Size* size) const override; | 41 void GetDialogSize(gfx::Size* size) const override; |
34 std::string GetDialogArgs() const override; | 42 std::string GetDialogArgs() const override; |
35 void OnDialogClosed(const std::string& json_retval) override; | 43 void OnDialogClosed(const std::string& json_retval) override; |
36 void OnCloseContents(content::WebContents* source, | 44 void OnCloseContents(content::WebContents* source, |
37 bool* out_close_dialog) override; | 45 bool* out_close_dialog) override; |
38 bool ShouldShowDialogTitle() const override; | 46 bool ShouldShowDialogTitle() const override; |
39 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 47 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
40 | 48 |
41 DISALLOW_COPY_AND_ASSIGN(SetTimeDialog); | 49 DISALLOW_COPY_AND_ASSIGN(SetTimeDialog); |
42 }; | 50 }; |
43 | 51 |
44 } // namespace chromeos | 52 } // namespace chromeos |
45 | 53 |
46 #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ | 54 #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ |
OLD | NEW |