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_METRO_DRIVER_METRO_DIALOG_BOX_H_ | 5 #ifndef CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_ |
6 #define CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_ | 6 #define CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_ |
7 | 7 |
8 #include <windows.ui.popups.h> | 8 #include <windows.ui.popups.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/win/metro.h" | 13 #include "base/win/metro.h" |
14 | 14 |
15 // Provides functionality to display a dialog box | 15 // Provides functionality to display a dialog box |
16 class MetroDialogBox : public winui::Popups::IUICommandInvokedHandler { | 16 class MetroDialogBox : public winui::Popups::IUICommandInvokedHandler { |
17 public: | 17 public: |
18 struct DialogBoxInfo { | 18 struct DialogBoxInfo { |
19 string16 title; | 19 base::string16 title; |
20 string16 content; | 20 base::string16 content; |
21 string16 button1_label; | 21 base::string16 button1_label; |
22 string16 button2_label; | 22 base::string16 button2_label; |
23 base::win::MetroDialogButtonPressedHandler button1_handler; | 23 base::win::MetroDialogButtonPressedHandler button1_handler; |
24 base::win::MetroDialogButtonPressedHandler button2_handler; | 24 base::win::MetroDialogButtonPressedHandler button2_handler; |
25 }; | 25 }; |
26 | 26 |
27 MetroDialogBox(); | 27 MetroDialogBox(); |
28 ~MetroDialogBox(); | 28 ~MetroDialogBox(); |
29 | 29 |
30 // Displays the dialog box. | 30 // Displays the dialog box. |
31 void Show(const DialogBoxInfo& dialog_box_info); | 31 void Show(const DialogBoxInfo& dialog_box_info); |
32 | 32 |
(...skipping 22 matching lines...) Expand all Loading... |
55 virtual HRESULT STDMETHODCALLTYPE Invoke(winui::Popups::IUICommand* command); | 55 virtual HRESULT STDMETHODCALLTYPE Invoke(winui::Popups::IUICommand* command); |
56 | 56 |
57 private: | 57 private: |
58 // The actual dialog box. | 58 // The actual dialog box. |
59 mswr::ComPtr<winui::Popups::IMessageDialog> dialog_box_; | 59 mswr::ComPtr<winui::Popups::IMessageDialog> dialog_box_; |
60 DialogBoxInfo dialog_box_info_; | 60 DialogBoxInfo dialog_box_info_; |
61 }; | 61 }; |
62 | 62 |
63 #endif // CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_ | 63 #endif // CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_ |
64 | 64 |
OLD | NEW |