summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 01:16:51 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 01:16:51 +0000
commitec79ca68d443ce2851fc577859816bbb577b5337 (patch)
tree1ef4278a503c6138309672cc35724787a3ea8bc9 /chrome/browser/first_run
parent016b57f941ec02b4342bb2fefb4bae5f83d10a9f (diff)
downloadchromium_src-ec79ca68d443ce2851fc577859816bbb577b5337.zip
chromium_src-ec79ca68d443ce2851fc577859816bbb577b5337.tar.gz
chromium_src-ec79ca68d443ce2851fc577859816bbb577b5337.tar.bz2
Get the toast working on win aura. This fixes TryChromeDialogBrowserTest.ToastCrasher.
There are activation issues with the toast, but at least it shows up and can be interacted with (when it works). Review URL: https://codereview.chromium.org/11275338 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r--chrome/browser/first_run/try_chrome_dialog_view.cc15
-rw-r--r--chrome/browser/first_run/try_chrome_dialog_view.h2
2 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc
index d4bc8ef..3581acc 100644
--- a/chrome/browser/first_run/try_chrome_dialog_view.cc
+++ b/chrome/browser/first_run/try_chrome_dialog_view.cc
@@ -28,6 +28,11 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+#if defined(USE_AURA)
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#endif
+
namespace {
const wchar_t kHelpCenterUrl[] =
@@ -261,8 +266,14 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal(
popup_->SetBounds(pos);
// Carve the toast shape into the window.
- SetToastRegion(popup_->GetNativeView(),
- preferred.width(), preferred.height());
+ HWND toast_window;
+#if defined(USE_AURA)
+ toast_window =
+ popup_->GetNativeView()->GetRootWindow()->GetAcceleratedWidget();
+#else
+ toast_window = popup_->GetNativeView();
+#endif
+ SetToastRegion(toast_window, preferred.width(), preferred.height());
// Time to show the window in a modal loop. The ProcessSingleton should
// already be locked and it will not process WM_COPYDATA requests. Change the
diff --git a/chrome/browser/first_run/try_chrome_dialog_view.h b/chrome/browser/first_run/try_chrome_dialog_view.h
index 97c0df7..ef5a156 100644
--- a/chrome/browser/first_run/try_chrome_dialog_view.h
+++ b/chrome/browser/first_run/try_chrome_dialog_view.h
@@ -83,7 +83,7 @@ class TryChromeDialogView : public views::ButtonListener,
// Create a windows region that looks like a toast of width |w| and height
// |h|. This is best effort, so we don't care much if the operation fails.
- void SetToastRegion(gfx::NativeWindow window, int w, int h);
+ void SetToastRegion(HWND window, int w, int h);
// views::ButtonListener:
// We have two buttons and according to what the user clicked we set |result_|