Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/browser/chromeos/set_time_dialog.h

Issue 2441133002: mash: Introduce ShowWebDialogWithContainer for webui dialogs (Closed)
Patch Set: review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/set_time_dialog.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 in the ash window hierarchy. Used
26 // when there is no explicit parent, for example at the login screen where
27 // the general settings window is not available. |container_id| is an
28 // an ash window container id. See ash/public/cpp/shell_window_ids.h.
29 static void ShowDialogInContainer(int container_id);
30
31 private:
21 SetTimeDialog(); 32 SetTimeDialog();
22 ~SetTimeDialog() override; 33 ~SetTimeDialog() override;
23 34
24 static void ShowDialog(gfx::NativeWindow owning_window); 35 static void ShowDialogImpl(gfx::NativeWindow parent, int container_id);
25 36
26 private:
27 // ui::WebDialogDelegate: 37 // ui::WebDialogDelegate:
28 ui::ModalType GetDialogModalType() const override; 38 ui::ModalType GetDialogModalType() const override;
29 base::string16 GetDialogTitle() const override; 39 base::string16 GetDialogTitle() const override;
30 GURL GetDialogContentURL() const override; 40 GURL GetDialogContentURL() const override;
31 void GetWebUIMessageHandlers( 41 void GetWebUIMessageHandlers(
32 std::vector<content::WebUIMessageHandler*>* handlers) const override; 42 std::vector<content::WebUIMessageHandler*>* handlers) const override;
33 void GetDialogSize(gfx::Size* size) const override; 43 void GetDialogSize(gfx::Size* size) const override;
34 std::string GetDialogArgs() const override; 44 std::string GetDialogArgs() const override;
35 void OnDialogClosed(const std::string& json_retval) override; 45 void OnDialogClosed(const std::string& json_retval) override;
36 void OnCloseContents(content::WebContents* source, 46 void OnCloseContents(content::WebContents* source,
37 bool* out_close_dialog) override; 47 bool* out_close_dialog) override;
38 bool ShouldShowDialogTitle() const override; 48 bool ShouldShowDialogTitle() const override;
39 bool HandleContextMenu(const content::ContextMenuParams& params) override; 49 bool HandleContextMenu(const content::ContextMenuParams& params) override;
40 50
41 DISALLOW_COPY_AND_ASSIGN(SetTimeDialog); 51 DISALLOW_COPY_AND_ASSIGN(SetTimeDialog);
42 }; 52 };
43 53
44 } // namespace chromeos 54 } // namespace chromeos
45 55
46 #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ 56 #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/set_time_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698