summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 00:37:02 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 00:37:02 +0000
commitfe8fa4c54238b86c22940e7fd672b4b44846083c (patch)
tree37f2df5c2ba2338de01c830c2d688f372ef858de /chrome/browser/views
parent8934a3b023fe473245c46edf3e7671552bf61188 (diff)
downloadchromium_src-fe8fa4c54238b86c22940e7fd672b4b44846083c.zip
chromium_src-fe8fa4c54238b86c22940e7fd672b4b44846083c.tar.gz
chromium_src-fe8fa4c54238b86c22940e7fd672b4b44846083c.tar.bz2
Fix issue 32106
Issue 32106 happens when user creates a browser window without creating desktop shortcut. In this case, Windows does not have sufficient relaunching info to support pinning the browser window. The fix is to create a shortcut in "User Pinned" folder which Win7 watches and would get relaunch info from it. Also fix a minor bug in win_util::SetAppIdForWindow that would make the function only work for Win7 but not above. BUG=32106 TEST=Verify fix for 32106. See comemnts #1 and #5 for repro steps. Review URL: http://codereview.chromium.org/660038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/new_profile_dialog.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/views/new_profile_dialog.cc b/chrome/browser/views/new_profile_dialog.cc
index f580bb0..9672a7a 100644
--- a/chrome/browser/views/new_profile_dialog.cc
+++ b/chrome/browser/views/new_profile_dialog.cc
@@ -8,8 +8,10 @@
#include "app/l10n_util.h"
#include "app/message_box_flags.h"
-#include "base/logging.h"
+#include "base/file_util.h"
#include "base/i18n/file_util_icu.h"
+#include "base/logging.h"
+#include "base/path_service.h"
#include "chrome/browser/user_data_manager.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -19,6 +21,10 @@
#include "views/view.h"
#include "views/window/window.h"
+#if defined(OS_WIN)
+#include "base/win_util.h"
+#endif // defined(OS_WIN)
+
namespace browser {
// Declared in browser_dialogs.h so others don't have to depend on our header.
@@ -99,9 +105,26 @@ bool NewProfileDialog::Accept() {
return true;
}
// Create a desktop shortcut if the corresponding checkbox is checked.
- if (message_box_view_->IsCheckBoxSelected())
+ if (message_box_view_->IsCheckBoxSelected()) {
UserDataManager::Get()->CreateDesktopShortcutForProfile(
profile_name);
+ } else {
+#if defined(OS_WIN)
+ if (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7) {
+ // For Win7, we need to have a shortcut in a place that Windows would
+ // index to provide correct relaunch info.
+ // See http://crbug.com/32106
+ FilePath temp_path;
+ if (PathService::Get(base::DIR_APP_DATA, &temp_path)) {
+ temp_path = temp_path.Append(
+ L"Microsoft\\Internet Explorer\\Quick Launch\\User Pinned");
+ UserDataManager::Get()->CreateShortcutForProfileInFolder(
+ temp_path,
+ profile_name);
+ }
+ }
+#endif // defined(OS_WIN)
+ }
UserDataManager::Get()->LaunchChromeForProfile(profile_name);
UserDataManager::Get()->RefreshUserDataDirProfiles();