summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run_win.cc
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 21:34:14 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-12 21:34:14 +0000
commit37a24e0d9e75a916c13900cf34d7c6b54acc2001 (patch)
tree3906a420c55d55e65b93a37a987bc0b016d1a308 /chrome/browser/first_run_win.cc
parent7c75df395ff1ca8095862328f6d5410071539f56 (diff)
downloadchromium_src-37a24e0d9e75a916c13900cf34d7c6b54acc2001.zip
chromium_src-37a24e0d9e75a916c13900cf34d7c6b54acc2001.tar.gz
chromium_src-37a24e0d9e75a916c13900cf34d7c6b54acc2001.tar.bz2
Tweaks to the try chrome toast
- Wire it to the cmdline param --try-chrome-again - Set window bounds so it looks nice on Vista - Enable the link to help center BUG=b/1484308 TEST=see the bug Review URL: http://codereview.chromium.org/126029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run_win.cc')
-rw-r--r--chrome/browser/first_run_win.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc
index 2ac5cac..136350c 100644
--- a/chrome/browser/first_run_win.cc
+++ b/chrome/browser/first_run_win.cc
@@ -7,6 +7,7 @@
#include <atlbase.h>
#include <atlcom.h>
#include <windows.h>
+#include <shellapi.h>
#include <shlobj.h>
#include <sstream>
@@ -673,10 +674,8 @@ class TryChromeDialog : public views::ButtonListener,
icon->SetImage(*rb.GetBitmapNamed(IDR_PRODUCT_ICON_32));
gfx::Size icon_size = icon->GetPreferredSize();
- const int width = 310;
- const int height = 160;
- gfx::Rect pos = ComputeWindowPosition(width, height);
-
+ // An approximate window size. After Layout() we'll get better bounds.
+ gfx::Rect pos(310, 160);
views::WidgetWin* popup = new views::WidgetWin();
if (!popup) {
NOTREACHED();
@@ -778,8 +777,16 @@ class TryChromeDialog : public views::ButtonListener,
link->SetController(this);
layout->AddView(link);
+ // We resize the window according to the layout manager. This takes into
+ // account the differences between XP and Vista fonts and buttons.
layout->Layout(root_view);
- SetToastRegion(popup->GetNativeView(), width, height);
+ gfx::Size preferred = layout->GetPreferredSize(root_view);
+ pos = ComputeWindowPosition(preferred.width(), preferred.height());
+ popup->SetBounds(pos);
+
+ // Carve the toast shape into the window.
+ SetToastRegion(popup->GetNativeView(),
+ preferred.width(), preferred.height());
// Time to show the window in a modal loop.
popup_ = popup;
popup_->Show();
@@ -806,6 +813,7 @@ class TryChromeDialog : public views::ButtonListener,
// fire off the default browser that by some convoluted logic should not be
// chrome.
virtual void LinkActivated(views::Link* source, int event_flags) {
+ ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW);
}
private: