summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-28 01:22:22 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-28 01:22:22 +0000
commit0a5f0a187c73e47417511ea2ed988c5b3876f563 (patch)
tree5a6677909cb754f86af8e4309e5160a6ade4260a
parent90a3fbb1723ba60bcf557121b7bbe80817a7533f (diff)
downloadchromium_src-0a5f0a187c73e47417511ea2ed988c5b3876f563.zip
chromium_src-0a5f0a187c73e47417511ea2ed988c5b3876f563.tar.gz
chromium_src-0a5f0a187c73e47417511ea2ed988c5b3876f563.tar.bz2
Wire chrome shortcuts tooltip (installation)
- Not complete since we are waiting for translations - For chromium the tooltip says "Browse the internet" BUG=b/1522969 Review URL: http://codereview.chromium.org/28272 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10666 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/first_run.cc5
-rw-r--r--chrome/installer/setup/setup.cc13
-rw-r--r--chrome/installer/util/browser_distribution.cc4
-rw-r--r--chrome/installer/util/browser_distribution.h2
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc5
-rw-r--r--chrome/installer/util/google_chrome_distribution.h2
-rw-r--r--chrome/installer/util/google_chrome_distribution_unittest.cc7
-rw-r--r--chrome/installer/util/shell_util.cc14
-rw-r--r--chrome/installer/util/shell_util.h2
9 files changed, 41 insertions, 13 deletions
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc
index 518218e..15e3fdb 100644
--- a/chrome/browser/first_run.cc
+++ b/chrome/browser/first_run.cc
@@ -148,8 +148,11 @@ bool FirstRun::CreateChromeDesktopShortcut() {
std::wstring chrome_exe;
if (!PathService::Get(base::FILE_EXE, &chrome_exe))
return false;
+ BrowserDistribution *dist = BrowserDistribution::GetDistribution();
+ if (!dist)
+ return false;
return ShellUtil::CreateChromeDesktopShortcut(chrome_exe,
- ShellUtil::CURRENT_USER, // create only for current user
+ dist->GetAppDescription(), ShellUtil::CURRENT_USER,
true); // create if doesnt exist
}
diff --git a/chrome/installer/setup/setup.cc b/chrome/installer/setup/setup.cc
index 046edd2..2ef653a 100644
--- a/chrome/installer/setup/setup.cc
+++ b/chrome/installer/setup/setup.cc
@@ -100,6 +100,7 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
// The location of Start->Programs->Google Chrome folder
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
const std::wstring& product_name = dist->GetApplicationName();
+ const std::wstring& product_desc = dist->GetAppDescription();
file_util::AppendToPath(&shortcut_path, product_name);
// Create/update Chrome link (points to chrome.exe) & Uninstall Chrome link
@@ -121,13 +122,13 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
file_util::CreateDirectoryW(shortcut_path);
LOG(INFO) << "Creating shortcut to " << chrome_exe << " at " << chrome_link;
- ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, chrome_link, true);
+ ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, chrome_link,
+ product_desc, true);
} else if (file_util::PathExists(chrome_link)) {
LOG(INFO) << "Updating shortcut at " << chrome_link
<< " to point to " << chrome_exe;
- ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe,
- chrome_link,
- false); // do not create new
+ ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, chrome_link,
+ product_desc, false);
}
// Create/update uninstall link
@@ -165,12 +166,12 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
bool create = (options & installer_util::CREATE_ALL_SHORTCUTS) != 0;
if (system_install) {
ret = ret && ShellUtil::CreateChromeDesktopShortcut(chrome_exe,
- ShellUtil::SYSTEM_LEVEL, create);
+ product_desc, ShellUtil::SYSTEM_LEVEL, create);
ret = ret && ShellUtil::CreateChromeQuickLaunchShortcut(chrome_exe,
ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, create);
} else {
ret = ret && ShellUtil::CreateChromeDesktopShortcut(chrome_exe,
- ShellUtil::CURRENT_USER, create);
+ product_desc, ShellUtil::CURRENT_USER, create);
ret = ret && ShellUtil::CreateChromeQuickLaunchShortcut(chrome_exe,
ShellUtil::CURRENT_USER, create);
}
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index c24d3c8..64a5ef3 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -38,6 +38,10 @@ std::wstring BrowserDistribution::GetPublisherName() {
return L"Chromium";
}
+std::wstring BrowserDistribution::GetAppDescription() {
+ return L"Browse the web";
+}
+
int BrowserDistribution::GetInstallReturnCode(
installer_util::InstallStatus install_status) {
return install_status;
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h
index 930f372..3ce15da 100644
--- a/chrome/installer/util/browser_distribution.h
+++ b/chrome/installer/util/browser_distribution.h
@@ -25,6 +25,8 @@ class BrowserDistribution {
virtual std::wstring GetPublisherName();
+ virtual std::wstring GetAppDescription();
+
virtual int GetInstallReturnCode(
installer_util::InstallStatus install_status);
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 77d0501..d477623 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -112,6 +112,11 @@ std::wstring GoogleChromeDistribution::GetPublisherName() {
return publisher_name;
}
+std::wstring GoogleChromeDistribution::GetAppDescription() {
+ // TODO(cpu): Wire the actual localized strings when they arrive.
+ return L"";
+}
+
int GoogleChromeDistribution::GetInstallReturnCode(
installer_util::InstallStatus status) {
switch (status) {
diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h
index 635e5aa..69227d4 100644
--- a/chrome/installer/util/google_chrome_distribution.h
+++ b/chrome/installer/util/google_chrome_distribution.h
@@ -36,6 +36,8 @@ class GoogleChromeDistribution : public BrowserDistribution {
virtual std::wstring GetPublisherName();
+ virtual std::wstring GetAppDescription();
+
virtual int GetInstallReturnCode(
installer_util::InstallStatus install_status);
diff --git a/chrome/installer/util/google_chrome_distribution_unittest.cc b/chrome/installer/util/google_chrome_distribution_unittest.cc
index 92bab77..063377a 100644
--- a/chrome/installer/util/google_chrome_distribution_unittest.cc
+++ b/chrome/installer/util/google_chrome_distribution_unittest.cc
@@ -225,3 +225,10 @@ TEST(MasterPreferences, ParseDistroParams) {
EXPECT_TRUE(file_util::Delete(prefs, false));
}
+TEST(BrowserDistribution, StringsTest) {
+ BrowserDistribution *dist = BrowserDistribution::GetDistribution();
+ ASSERT_TRUE(dist != NULL);
+ std::wstring name = dist->GetApplicationName();
+ std::wstring desc = dist->GetAppDescription();
+ // TODO(cpu) finish the test when the translated strings arrive.
+}
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 422173c..62ee897 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -486,6 +486,7 @@ bool ShellUtil::GetQuickLaunchPath(bool system_level, std::wstring* path) {
}
bool ShellUtil::CreateChromeDesktopShortcut(const std::wstring& chrome_exe,
+ const std::wstring& description,
int shell_change,
bool create_new) {
std::wstring shortcut_name;
@@ -498,7 +499,7 @@ bool ShellUtil::CreateChromeDesktopShortcut(const std::wstring& chrome_exe,
if (ShellUtil::GetDesktopPath(false, &shortcut_path)) {
file_util::AppendToPath(&shortcut_path, shortcut_name);
ret = ShellUtil::UpdateChromeShortcut(chrome_exe, shortcut_path,
- create_new);
+ description, create_new);
} else {
ret = false;
}
@@ -510,7 +511,7 @@ bool ShellUtil::CreateChromeDesktopShortcut(const std::wstring& chrome_exe,
// Note we need to call the create operation and then AND the result
// with the create operation of user level shortcut.
ret = ShellUtil::UpdateChromeShortcut(chrome_exe, shortcut_path,
- create_new) && ret;
+ description, create_new) && ret;
} else {
ret = false;
}
@@ -532,7 +533,7 @@ bool ShellUtil::CreateChromeQuickLaunchShortcut(const std::wstring& chrome_exe,
if (ShellUtil::GetQuickLaunchPath(false, &user_ql_path)) {
file_util::AppendToPath(&user_ql_path, shortcut_name);
ret = ShellUtil::UpdateChromeShortcut(chrome_exe, user_ql_path,
- create_new);
+ L"", create_new);
} else {
ret = false;
}
@@ -545,7 +546,7 @@ bool ShellUtil::CreateChromeQuickLaunchShortcut(const std::wstring& chrome_exe,
if (ShellUtil::GetQuickLaunchPath(true, &default_ql_path)) {
file_util::AppendToPath(&default_ql_path, shortcut_name);
ret = ShellUtil::UpdateChromeShortcut(chrome_exe, default_ql_path,
- create_new) && ret;
+ L"", create_new) && ret;
} else {
ret = false;
}
@@ -657,6 +658,7 @@ bool ShellUtil::RemoveChromeQuickLaunchShortcut(int shell_change) {
bool ShellUtil::UpdateChromeShortcut(const std::wstring& chrome_exe,
const std::wstring& shortcut,
+ const std::wstring& description,
bool create_new) {
std::wstring chrome_path = file_util::GetDirectoryFromPath(chrome_exe);
if (create_new) {
@@ -664,7 +666,7 @@ bool ShellUtil::UpdateChromeShortcut(const std::wstring& chrome_exe,
shortcut.c_str(), // shortcut
chrome_path.c_str(), // working dir
NULL, // arguments
- NULL, // description
+ description.c_str(), // description
chrome_exe.c_str(), // icon file
0); // icon index
} else {
@@ -672,7 +674,7 @@ bool ShellUtil::UpdateChromeShortcut(const std::wstring& chrome_exe,
shortcut.c_str(), // shortcut
chrome_path.c_str(), // working dir
NULL, // arguments
- NULL, // description
+ description.c_str(), // description
chrome_exe.c_str(), // icon file
0); // icon index
}
diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h
index 8fd9ae6..f8d015d 100644
--- a/chrome/installer/util/shell_util.h
+++ b/chrome/installer/util/shell_util.h
@@ -112,6 +112,7 @@ class ShellUtil {
// create_new: If false, will only update the shortcut. If true, the function
// will create a new shortcut if it doesn't exist already.
static bool CreateChromeDesktopShortcut(const std::wstring& chrome_exe,
+ const std::wstring& description,
int shell_change,
bool create_new);
@@ -192,6 +193,7 @@ class ShellUtil {
// if doesn't exist.
static bool UpdateChromeShortcut(const std::wstring& chrome_exe,
const std::wstring& shortcut,
+ const std::wstring& description,
bool create_new);
private: