| 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); |
| 28 |
| 29 private: |
| 21 SetTimeDialog(); | 30 SetTimeDialog(); |
| 22 ~SetTimeDialog() override; | 31 ~SetTimeDialog() override; |
| 23 | 32 |
| 24 static void ShowDialog(gfx::NativeWindow owning_window); | |
| 25 | |
| 26 private: | |
| 27 // ui::WebDialogDelegate: | 33 // ui::WebDialogDelegate: |
| 28 ui::ModalType GetDialogModalType() const override; | 34 ui::ModalType GetDialogModalType() const override; |
| 29 base::string16 GetDialogTitle() const override; | 35 base::string16 GetDialogTitle() const override; |
| 30 GURL GetDialogContentURL() const override; | 36 GURL GetDialogContentURL() const override; |
| 31 void GetWebUIMessageHandlers( | 37 void GetWebUIMessageHandlers( |
| 32 std::vector<content::WebUIMessageHandler*>* handlers) const override; | 38 std::vector<content::WebUIMessageHandler*>* handlers) const override; |
| 33 void GetDialogSize(gfx::Size* size) const override; | 39 void GetDialogSize(gfx::Size* size) const override; |
| 34 std::string GetDialogArgs() const override; | 40 std::string GetDialogArgs() const override; |
| 35 void OnDialogClosed(const std::string& json_retval) override; | 41 void OnDialogClosed(const std::string& json_retval) override; |
| 36 void OnCloseContents(content::WebContents* source, | 42 void OnCloseContents(content::WebContents* source, |
| 37 bool* out_close_dialog) override; | 43 bool* out_close_dialog) override; |
| 38 bool ShouldShowDialogTitle() const override; | 44 bool ShouldShowDialogTitle() const override; |
| 39 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 45 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
| 40 | 46 |
| 41 DISALLOW_COPY_AND_ASSIGN(SetTimeDialog); | 47 DISALLOW_COPY_AND_ASSIGN(SetTimeDialog); |
| 42 }; | 48 }; |
| 43 | 49 |
| 44 } // namespace chromeos | 50 } // namespace chromeos |
| 45 | 51 |
| 46 #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ | 52 #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ |
| OLD | NEW |