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

Unified Diff: chrome/browser/ui/views/app_list/app_list_controller_win.cc

Issue 13864015: Move app launcher and chrome apps shortcut strings into the installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_app_id_fix
Patch Set: rework Created 7 years, 8 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
Index: chrome/browser/ui/views/app_list/app_list_controller_win.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
index 069ba1d0b415270efab79b0c656038bd9436cf82..6acb57ee5260165e7813f48a8ffef0658e244ebd 100644
--- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc
+++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc
@@ -43,6 +43,7 @@
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/google_update_settings.h"
+#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/util_constants.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
@@ -62,10 +63,6 @@
#include "ui/views/widget/widget.h"
#include "win8/util/win8_util.h"
-#if defined(GOOGLE_CHROME_BUILD)
-#include "chrome/installer/util/install_util.h"
gab 2013/04/29 21:34:44 I don't see what in this diff justifies this chang
calamity 2013/04/30 08:11:28 Done.
-#endif
-
#if defined(USE_AURA)
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -159,6 +156,11 @@ void CreateAppListShortcuts(
const ShellIntegration::ShortcutLocations& creation_locations) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
+ base::FilePath chrome_exe;
+ if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
+ NOTREACHED();
+ }
+
// Shortcut paths under which to create shortcuts.
std::vector<base::FilePath> shortcut_paths =
web_app::internals::GetShortcutPaths(creation_locations);
@@ -166,17 +168,6 @@ void CreateAppListShortcuts(
bool pin_to_taskbar = creation_locations.in_quick_launch_bar &&
(base::win::GetVersion() >= base::win::VERSION_WIN7);
- // Create a shortcut in the |user_data_dir| for taskbar pinning.
- if (pin_to_taskbar)
- shortcut_paths.push_back(user_data_dir);
- bool success = true;
-
- base::FilePath chrome_exe;
gab 2013/04/29 21:34:44 This code can comeback here (i.e. let's keep this
calamity 2013/04/30 08:11:28 Done.
- if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
- NOTREACHED();
- return;
- }
-
string16 wide_switches(GetAppListCommandLine().GetArgumentsString());
base::win::ShortcutProperties shortcut_properties;
@@ -197,18 +188,21 @@ void CreateAppListShortcuts(
if (!file_util::PathExists(shortcut_file.DirName()) &&
!file_util::CreateDirectory(shortcut_file.DirName())) {
NOTREACHED();
- return;
+ continue;
}
- success = success && base::win::CreateOrUpdateShortcutLink(
- shortcut_file, shortcut_properties,
- base::win::SHORTCUT_CREATE_ALWAYS);
+ base::win::CreateOrUpdateShortcutLink(shortcut_file,
+ shortcut_properties,
+ base::win::SHORTCUT_CREATE_ALWAYS);
}
- if (success && pin_to_taskbar) {
- base::FilePath shortcut_to_pin = user_data_dir.Append(file_name).
- AddExtension(installer::kLnkExt);
- success = base::win::TaskbarPinShortcutLink(
- shortcut_to_pin.value().c_str()) && success;
+ // Create a shortcut in the |user_data_dir| for taskbar pinning.
+ if (pin_to_taskbar) {
+ base::FilePath shortcut_file = user_data_dir.Append(file_name).
+ AddExtension(installer::kLnkExt);
gab 2013/04/29 21:34:44 nit: indent
calamity 2013/04/30 08:11:28 Done.
gab 2013/04/30 15:00:24 I meant that it was indented 6 spaces instead of 4
+ if (base::win::CreateOrUpdateShortcutLink(shortcut_file,
+ shortcut_properties,
gab 2013/04/29 21:34:44 nit: indent
calamity 2013/04/30 08:11:28 Done.
+ base::win::SHORTCUT_CREATE_ALWAYS))
+ base::win::TaskbarPinShortcutLink(shortcut_file.value().c_str());
gab 2013/04/29 21:34:44 Add {} around if content since condition spans mor
calamity 2013/04/30 08:11:28 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698