Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3003)

Unified Diff: chrome/browser/shell_integration_win.cc

Issue 10699040: Relaunch Chrome in metro-mode with the help of a helper process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/shell_integration.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_win.cc
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index ceb412c0935cd8e8790a3fbb4965d47b3dcb1a0d..7cdb24e6ce5da826635c27882e9ea772c1d06200 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -32,6 +32,7 @@
#include "chrome/installer/setup/setup_util.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/create_reg_key_work_item.h"
+#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/set_reg_value_work_item.h"
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
@@ -611,3 +612,30 @@ bool ShellIntegration::ActivateMetroChrome() {
ShellUtil::GetBrowserModelId(dist, chrome_exe.value()));
return ActivateApplication(app_id);
}
+
+FilePath ShellIntegration::GetStartMenuShortcut(const FilePath& chrome_exe) {
+ static const int kFolderIds[] = {
+ base::DIR_COMMON_START_MENU,
+ base::DIR_START_MENU,
+ };
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ string16 shortcut_name(dist->GetAppShortCutName());
+ FilePath shortcut;
+
+ // Check both the common and the per-user Start Menu folders for system-level
+ // installs.
+ size_t folder =
+ InstallUtil::IsPerUserInstall(chrome_exe.value().c_str()) ? 1 : 0;
+ for (; folder < arraysize(kFolderIds); ++folder) {
+ if (!PathService::Get(kFolderIds[folder], &shortcut)) {
+ NOTREACHED();
+ continue;
+ }
+
+ shortcut = shortcut.Append(shortcut_name).Append(shortcut_name + L".lnk");
+ if (file_util::PathExists(shortcut))
+ return shortcut;
+ }
+
+ return FilePath();
+}
« no previous file with comments | « chrome/browser/shell_integration.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698