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

Unified Diff: chrome/browser/ui/web_applications/web_app_ui.cc

Issue 10914109: Refactoring and tests for the highly undertested file_util::CreateOrUpdateShortcutLink() method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: namespace s/Win/win Created 8 years, 3 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_win.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/web_applications/web_app_ui.cc
diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc
index 85285d34eee07b8d9ad4699f70240aa757a6f20f..bcfb9f4c311ba8ef0e47f2bbd4aa613e0ec4e349 100644
--- a/chrome/browser/ui/web_applications/web_app_ui.cc
+++ b/chrome/browser/ui/web_applications/web_app_ui.cc
@@ -10,7 +10,6 @@
#include "base/path_service.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
-#include "base/win/windows_version.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -28,6 +27,11 @@
#include "base/environment.h"
#endif
+#if defined(OS_WIN)
+#include "base/win/shortcut.h"
+#include "base/win/windows_version.h"
+#endif
+
using content::BrowserThread;
using content::NavigationController;
using content::WebContents;
@@ -258,16 +262,14 @@ void UpdateShortcutWorker::UpdateShortcutsOnFileThread() {
shortcut_info_.description.resize(MAX_PATH - 1);
for (size_t i = 0; i < shortcut_files_.size(); ++i) {
- file_util::CreateOrUpdateShortcutLink(
- NULL,
- shortcut_files_[i].value().c_str(),
- NULL,
- NULL,
- shortcut_info_.description.c_str(),
- icon_file.value().c_str(),
- 0,
- app_id.c_str(),
- file_util::SHORTCUT_NO_OPTIONS);
+ base::win::ShortcutProperties shortcut_properties;
+ shortcut_properties.set_target(shortcut_files_[i]);
+ shortcut_properties.set_description(shortcut_info_.description);
+ shortcut_properties.set_icon(icon_file, 0);
+ shortcut_properties.set_app_id(app_id);
+ base::win::CreateOrUpdateShortcutLink(
+ shortcut_files_[i], shortcut_properties,
+ base::win::SHORTCUT_UPDATE_EXISTING);
}
}
« no previous file with comments | « chrome/browser/shell_integration_win.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698