summaryrefslogtreecommitdiffstats
path: root/win8/metro_driver/metro_dialog_box.h
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-07 20:44:51 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-07 20:44:51 +0000
commitbd63ce0ad16cab9822d7120bdcf2d5b7353598e3 (patch)
treeaed796bf22fb22cf0a7ff1e6c12b151de3f5bf40 /win8/metro_driver/metro_dialog_box.h
parent25da1685160963a14710a128977525ea55aee091 (diff)
downloadchromium_src-bd63ce0ad16cab9822d7120bdcf2d5b7353598e3.zip
chromium_src-bd63ce0ad16cab9822d7120bdcf2d5b7353598e3.tar.gz
chromium_src-bd63ce0ad16cab9822d7120bdcf2d5b7353598e3.tar.bz2
Integrate the Windows 8 code into the Chromium tree (take 3).
This time, also: fix invalid path in metro_driver.gyp. set executable bit on check_sdk_patch.py and post_build.bat. add back a switch that was removed recently This reverts "Revert 155429 - Integrate the Windows 8 code into the Chromium tree." Original CL: https://chromiumcodereview.appspot.com/10875008 BUG=127799 TEST=A Chromium build can run as the immersive browser on Windows 8. TBR=ben Review URL: https://chromiumcodereview.appspot.com/10919158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155474 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/metro_driver/metro_dialog_box.h')
-rw-r--r--win8/metro_driver/metro_dialog_box.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/win8/metro_driver/metro_dialog_box.h b/win8/metro_driver/metro_dialog_box.h
new file mode 100644
index 0000000..5a6a94d
--- /dev/null
+++ b/win8/metro_driver/metro_dialog_box.h
@@ -0,0 +1,64 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_
+#define CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_
+
+#include <windows.ui.popups.h>
+#include <string>
+
+#include "base/logging.h"
+#include "base/memory/ref_counted.h"
+#include "base/win/metro.h"
+
+// Provides functionality to display a dialog box
+class MetroDialogBox : public winui::Popups::IUICommandInvokedHandler {
+ public:
+ struct DialogBoxInfo {
+ string16 title;
+ string16 content;
+ string16 button1_label;
+ string16 button2_label;
+ base::win::MetroDialogButtonPressedHandler button1_handler;
+ base::win::MetroDialogButtonPressedHandler button2_handler;
+ };
+
+ MetroDialogBox();
+ ~MetroDialogBox();
+
+ // Displays the dialog box.
+ void Show(const DialogBoxInfo& dialog_box_info);
+
+ // Dismisses the dialog box.
+ void Dismiss();
+
+ // IUICommandInvokedHandler implementation.
+ // Dummy implementation of IUnknown. This is fine as the lifetime of this
+ // class is tied to the lifetime of the ChromeAppView instance.
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** object) {
+ DVLOG(1) << __FUNCTION__;
+ CHECK(false);
+ return E_NOINTERFACE;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE AddRef(void) {
+ DVLOG(1) << __FUNCTION__;
+ return 1;
+ }
+
+ virtual ULONG STDMETHODCALLTYPE Release(void) {
+ DVLOG(1) << __FUNCTION__;
+ return 1;
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Invoke(winui::Popups::IUICommand* command);
+
+ private:
+ // The actual dialog box.
+ mswr::ComPtr<winui::Popups::IMessageDialog> dialog_box_;
+ DialogBoxInfo dialog_box_info_;
+};
+
+#endif // CHROME_BROWSER_UI_METRO_DRIVER_METRO_DIALOG_BOX_H_
+