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

Side by Side Diff: chrome/browser/chrome_browser_main_win.cc

Issue 10823217: Create/Delete windows profile shortcuts (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main_win.h" 5 #include "chrome/browser/chrome_browser_main_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/environment.h" 13 #include "base/environment.h"
14 #include "base/i18n/rtl.h" 14 #include "base/i18n/rtl.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/scoped_native_library.h" 17 #include "base/scoped_native_library.h"
18 #include "base/string_number_conversions.h" 18 #include "base/string_number_conversions.h"
19 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
20 #include "base/win/metro.h" 20 #include "base/win/metro.h"
21 #include "base/win/windows_version.h" 21 #include "base/win/windows_version.h"
22 #include "base/win/wrapped_window_proc.h" 22 #include "base/win/wrapped_window_proc.h"
23 #include "chrome/browser/browser_util_win.h" 23 #include "chrome/browser/browser_util_win.h"
24 #include "chrome/browser/first_run/first_run.h" 24 #include "chrome/browser/first_run/first_run.h"
25 #include "chrome/browser/media_gallery/media_device_notifications_window_win.h" 25 #include "chrome/browser/media_gallery/media_device_notifications_window_win.h"
26 #include "chrome/browser/metrics/metrics_service.h" 26 #include "chrome/browser/metrics/metrics_service.h"
27 #include "chrome/browser/profiles/profile_info_cache.h" 27 #include "chrome/browser/profiles/profile_info_cache.h"
28 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" 28 #include "chrome/browser/profiles/profile_shortcut_manager.h"
29 #include "chrome/browser/ui/simple_message_box.h" 29 #include "chrome/browser/ui/simple_message_box.h"
30 #include "chrome/browser/ui/uninstall_browser_prompt.h" 30 #include "chrome/browser/ui/uninstall_browser_prompt.h"
31 #include "chrome/common/chrome_constants.h" 31 #include "chrome/common/chrome_constants.h"
32 #include "chrome/common/chrome_result_codes.h" 32 #include "chrome/common/chrome_result_codes.h"
33 #include "chrome/common/chrome_switches.h" 33 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/env_vars.h" 34 #include "chrome/common/env_vars.h"
35 #include "chrome/installer/util/browser_distribution.h" 35 #include "chrome/installer/util/browser_distribution.h"
36 #include "chrome/installer/util/helper.h" 36 #include "chrome/installer/util/helper.h"
37 #include "chrome/installer/util/install_util.h" 37 #include "chrome/installer/util/install_util.h"
38 #include "chrome/installer/util/l10n_string_util.h" 38 #include "chrome/installer/util/l10n_string_util.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 VLOG(1) << "Executing uninstall actions"; 125 VLOG(1) << "Executing uninstall actions";
126 if (!first_run::RemoveSentinel()) 126 if (!first_run::RemoveSentinel())
127 VLOG(1) << "Failed to delete sentinel file."; 127 VLOG(1) << "Failed to delete sentinel file.";
128 // We want to remove user level shortcuts and we only care about the ones 128 // We want to remove user level shortcuts and we only care about the ones
129 // created by us and not by the installer so |alternate| is false. 129 // created by us and not by the installer so |alternate| is false.
130 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 130 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
131 if (!ShellUtil::RemoveChromeDesktopShortcut( 131 if (!ShellUtil::RemoveChromeDesktopShortcut(
132 dist, ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_NO_OPTIONS)) { 132 dist, ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_NO_OPTIONS)) {
133 VLOG(1) << "Failed to delete desktop shortcut."; 133 VLOG(1) << "Failed to delete desktop shortcut.";
134 } 134 }
135 if (!ShellUtil::RemoveChromeDesktopShortcutsWithAppendedNames(
136 ProfileShortcutManagerWin::GenerateShortcutsFromProfiles(
137 ProfileInfoCache::GetProfileNames()))) {
138 VLOG(1) << "Failed to delete desktop profiles shortcuts.";
SteveT 2012/08/15 18:29:41 Wait, so what's our cleanup plan now that this gon
Halli 2012/08/15 19:29:59 Different CL. I'll make a note. On 2012/08/15 18:2
139 }
140 if (!ShellUtil::RemoveChromeQuickLaunchShortcut(dist, 135 if (!ShellUtil::RemoveChromeQuickLaunchShortcut(dist,
141 ShellUtil::CURRENT_USER)) { 136 ShellUtil::CURRENT_USER)) {
142 VLOG(1) << "Failed to delete quick launch shortcut."; 137 VLOG(1) << "Failed to delete quick launch shortcut.";
143 } 138 }
144 } 139 }
145 return result; 140 return result;
146 } 141 }
147 142
148 // ChromeBrowserMainPartsWin --------------------------------------------------- 143 // ChromeBrowserMainPartsWin ---------------------------------------------------
149 144
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (resource_id) 339 if (resource_id)
345 return l10n_util::GetStringUTF16(resource_id); 340 return l10n_util::GetStringUTF16(resource_id);
346 return string16(); 341 return string16();
347 } 342 }
348 343
349 // static 344 // static
350 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 345 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
351 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 346 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
352 installer::SetTranslationDelegate(&delegate); 347 installer::SetTranslationDelegate(&delegate);
353 } 348 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/avatar_menu_model.cc » ('j') | chrome/browser/profiles/avatar_menu_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698