summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevet@chromium.org <stevet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-17 17:44:36 +0000
committerstevet@chromium.org <stevet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-17 17:44:36 +0000
commit04bdebfa5c0a7aee88220c20b3b8d483f79a3d12 (patch)
treed2b1e6516431f8a0162463520caa6a329deba42a
parent67e3cda094a22fbde58c42b5617cb63f187e4320 (diff)
downloadchromium_src-04bdebfa5c0a7aee88220c20b3b8d483f79a3d12.zip
chromium_src-04bdebfa5c0a7aee88220c20b3b8d483f79a3d12.tar.gz
chromium_src-04bdebfa5c0a7aee88220c20b3b8d483f79a3d12.tar.bz2
Check the browser distribution when determining whether or not we should create desktop shortcuts, rather than the no-first-run flag.
BUG=108362 TEST=Ensure that installing Chrome Frame and visiting a Chrome Frame enabled page does not create any desktop shortcuts in Windows. Ensure that running a pyauto test that runs the OpenNewBrowserWindowWithNewProfile hook also creates desktop shortcuts. Review URL: http://codereview.chromium.org/9227010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117910 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/first_run/first_run_win.cc2
-rw-r--r--chrome/browser/profiles/profile_manager.cc7
-rw-r--r--chrome/installer/util/browser_distribution.cc6
-rw-r--r--chrome/installer/util/browser_distribution.h4
-rw-r--r--chrome/installer/util/chrome_frame_distribution.cc6
-rw-r--r--chrome/installer/util/chrome_frame_distribution.h4
6 files changed, 22 insertions, 7 deletions
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index ca0f40b..2017bca 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -107,7 +107,7 @@ bool CreateChromeDesktopShortcut() {
if (!PathService::Get(base::FILE_EXE, &chrome_exe))
return false;
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- if (!dist)
+ if (!dist || !dist->CanCreateDesktopShortcuts())
return false;
return ShellUtil::CreateChromeDesktopShortcut(
dist,
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 9217ef1..7c7879e 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -33,6 +33,9 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#if defined(OS_WIN)
+#include "chrome/installer/util/browser_distribution.h"
+#endif
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/user_metrics.h"
@@ -676,8 +679,8 @@ ProfileInfoCache& ProfileManager::GetProfileInfoCache() {
profile_info_cache_.reset(new ProfileInfoCache(
g_browser_process->local_state(), user_data_dir_));
#if defined(OS_WIN)
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kNoFirstRun)) {
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
+ if (dist && dist->CanCreateDesktopShortcuts()) {
profile_shortcut_manager_.reset(new ProfileShortcutManagerWin());
profile_info_cache_->AddObserver(profile_shortcut_manager_.get());
}
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 535797a..88c5b7e 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
//
@@ -213,6 +213,10 @@ bool BrowserDistribution::CanSetAsDefault() {
return true;
}
+bool BrowserDistribution::CanCreateDesktopShortcuts() {
+ return true;
+}
+
int BrowserDistribution::GetIconIndex() {
return 0;
}
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h
index 81a291b..938440f 100644
--- a/chrome/installer/util/browser_distribution.h
+++ b/chrome/installer/util/browser_distribution.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
//
@@ -107,6 +107,8 @@ class BrowserDistribution {
virtual bool CanSetAsDefault();
+ virtual bool CanCreateDesktopShortcuts();
+
virtual int GetIconIndex();
virtual bool GetChromeChannel(std::wstring* channel);
diff --git a/chrome/installer/util/chrome_frame_distribution.cc b/chrome/installer/util/chrome_frame_distribution.cc
index 576dc4a..d36f8b1 100644
--- a/chrome/installer/util/chrome_frame_distribution.cc
+++ b/chrome/installer/util/chrome_frame_distribution.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
//
@@ -113,6 +113,10 @@ bool ChromeFrameDistribution::CanSetAsDefault() {
return false;
}
+bool ChromeFrameDistribution::CanCreateDesktopShortcuts() {
+ return false;
+}
+
void ChromeFrameDistribution::UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) {
diff --git a/chrome/installer/util/chrome_frame_distribution.h b/chrome/installer/util/chrome_frame_distribution.h
index 6b037ae..cb737e9 100644
--- a/chrome/installer/util/chrome_frame_distribution.h
+++ b/chrome/installer/util/chrome_frame_distribution.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
//
@@ -51,6 +51,8 @@ class ChromeFrameDistribution : public BrowserDistribution {
virtual bool CanSetAsDefault() OVERRIDE;
+ virtual bool CanCreateDesktopShortcuts() OVERRIDE;
+
virtual void UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) OVERRIDE;