blob: 46853b8f4ae9a2e869751a22cd5734582e33aeda [file] [log] [blame]
[email protected]b6b72222012-02-11 02:04:131// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]d24c4012009-07-28 01:57:312// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
pmonette32a5cfb42016-04-11 22:04:445#include "chrome/browser/shell_integration_win.h"
[email protected]d24c4012009-07-28 01:57:316
7#include <windows.h>
[email protected]caa05352014-03-01 00:43:058#include <shlwapi.h>
[email protected]d24c4012009-07-28 01:57:319#include <shobjidl.h>
thestig18dfb7a52014-08-26 10:44:0410#include <propkey.h> // Needs to come after shobjidl.h.
avi664c07b2015-12-26 02:18:3111#include <stddef.h>
12#include <stdint.h>
[email protected]d24c4012009-07-28 01:57:3113
pmonettea98315242016-11-23 21:39:1814#include <memory>
15#include <utility>
pmonette32a5cfb42016-04-11 22:04:4416#include <vector>
17
[email protected]3a3e72c2011-11-29 02:59:3818#include "base/bind.h"
pmonette32a5cfb42016-04-11 22:04:4419#include "base/callback.h"
[email protected]d24c4012009-07-28 01:57:3120#include "base/command_line.h"
[email protected]25a4c1c2013-06-08 04:53:3621#include "base/files/file_enumerator.h"
thestig18dfb7a52014-08-26 10:44:0422#include "base/files/file_util.h"
avi664c07b2015-12-26 02:18:3123#include "base/macros.h"
dcheng4af48582016-04-19 00:29:3524#include "base/memory/ptr_util.h"
pmonette32a5cfb42016-04-11 22:04:4425#include "base/memory/weak_ptr.h"
[email protected]fa1e0e12013-07-18 00:10:1426#include "base/message_loop/message_loop.h"
pmonette32a5cfb42016-04-11 22:04:4427#include "base/metrics/histogram_macros.h"
grtc291eea2016-05-26 15:38:4828#include "base/metrics/user_metrics.h"
29#include "base/metrics/user_metrics_action.h"
[email protected]d24c4012009-07-28 01:57:3130#include "base/path_service.h"
[email protected]24a555b62013-06-10 22:01:1731#include "base/strings/string_util.h"
32#include "base/strings/stringprintf.h"
[email protected]e309f312013-06-07 21:50:0833#include "base/strings/utf_string_conversions.h"
pmonette32a5cfb42016-04-11 22:04:4434#include "base/time/time.h"
35#include "base/timer/timer.h"
[email protected]2d6503982010-10-17 04:41:5436#include "base/win/registry.h"
[email protected]8ee65ba2011-04-12 20:53:2337#include "base/win/scoped_comptr.h"
[email protected]07983302013-01-21 19:41:4438#include "base/win/scoped_propvariant.h"
[email protected]f1024e22012-09-12 07:14:5539#include "base/win/shortcut.h"
[email protected]935aa542010-10-15 01:59:1540#include "base/win/windows_version.h"
[email protected]89d43832013-06-29 20:25:2041#include "chrome/browser/policy/policy_path_parser.h"
pmonette32a5cfb42016-04-11 22:04:4442#include "chrome/browser/shell_integration.h"
[email protected]c9bb06f42010-01-13 23:53:4843#include "chrome/browser/web_applications/web_app.h"
grtc291eea2016-05-26 15:38:4844#include "chrome/browser/win/settings_app_monitor.h"
[email protected]d24c4012009-07-28 01:57:3145#include "chrome/common/chrome_constants.h"
[email protected]12f520c2010-01-06 18:11:1546#include "chrome/common/chrome_paths_internal.h"
[email protected]c9bb06f42010-01-13 23:53:4847#include "chrome/common/chrome_switches.h"
pmonette5057ca3b2016-07-04 16:48:4048#include "chrome/common/shell_handler_win.mojom.h"
49#include "chrome/grit/generated_resources.h"
grtc98803462017-03-08 10:05:0850#include "chrome/install_static/install_util.h"
[email protected]d24c4012009-07-28 01:57:3151#include "chrome/installer/util/browser_distribution.h"
[email protected]3f69d6e612012-08-03 18:52:2752#include "chrome/installer/util/install_util.h"
pmonette0c40087a2016-04-21 00:05:1653#include "chrome/installer/util/scoped_user_protocol_entry.h"
[email protected]d24c4012009-07-28 01:57:3154#include "chrome/installer/util/shell_util.h"
pmonette2b1dbee2016-01-08 20:18:5855#include "components/variations/variations_associated_data.h"
[email protected]c38831a12011-10-28 12:44:4956#include "content/public/browser/browser_thread.h"
pmonette5057ca3b2016-07-04 16:48:4057#include "content/public/browser/utility_process_mojo_client.h"
58#include "ui/base/l10n/l10n_util.h"
[email protected]d24c4012009-07-28 01:57:3159
[email protected]631bb742011-11-02 11:29:3960using content::BrowserThread;
61
pmonette9fa59e882016-02-10 00:12:1962namespace shell_integration {
63
[email protected]12f520c2010-01-06 18:11:1564namespace {
65
pmonette9fa59e882016-02-10 00:12:1966// Helper function for GetAppId to generates profile id
[email protected]2f1c09d2011-01-14 14:58:1467// from profile path. "profile_id" is composed of sanitized basenames of
[email protected]12f520c2010-01-06 18:11:1568// user data dir and profile dir joined by a ".".
[email protected]6a72a632013-12-12 22:22:0069base::string16 GetProfileIdFromPath(const base::FilePath& profile_path) {
[email protected]12f520c2010-01-06 18:11:1570 // Return empty string if profile_path is empty
71 if (profile_path.empty())
[email protected]0085863a2013-12-06 21:19:0372 return base::string16();
[email protected]12f520c2010-01-06 18:11:1573
[email protected]650b2d52013-02-10 03:41:4574 base::FilePath default_user_data_dir;
[email protected]12f520c2010-01-06 18:11:1575 // Return empty string if profile_path is in default user data
76 // dir and is the default profile.
77 if (chrome::GetDefaultUserDataDirectory(&default_user_data_dir) &&
78 profile_path.DirName() == default_user_data_dir &&
[email protected]162b5992011-03-15 19:40:4879 profile_path.BaseName().value() ==
[email protected]f911df52013-12-24 23:24:2380 base::ASCIIToUTF16(chrome::kInitialProfile)) {
[email protected]0085863a2013-12-06 21:19:0381 return base::string16();
[email protected]162b5992011-03-15 19:40:4882 }
[email protected]12f520c2010-01-06 18:11:1583
84 // Get joined basenames of user data dir and profile.
[email protected]0085863a2013-12-06 21:19:0385 base::string16 basenames = profile_path.DirName().BaseName().value() +
[email protected]12f520c2010-01-06 18:11:1586 L"." + profile_path.BaseName().value();
87
[email protected]0085863a2013-12-06 21:19:0388 base::string16 profile_id;
[email protected]12f520c2010-01-06 18:11:1589 profile_id.reserve(basenames.size());
90
91 // Generate profile_id from sanitized basenames.
92 for (size_t i = 0; i < basenames.length(); ++i) {
brettwb3413062015-06-24 00:39:0293 if (base::IsAsciiAlpha(basenames[i]) ||
94 base::IsAsciiDigit(basenames[i]) ||
[email protected]12f520c2010-01-06 18:11:1595 basenames[i] == L'.')
96 profile_id += basenames[i];
97 }
98
99 return profile_id;
100}
101
taptedc2c690ab2016-05-25 02:49:03102base::string16 GetAppListAppName() {
103 static const base::char16 kAppListAppNameSuffix[] = L"AppList";
grtc98803462017-03-08 10:05:08104 base::string16 app_name(install_static::GetBaseAppId());
taptedc2c690ab2016-05-25 02:49:03105 app_name.append(kAppListAppNameSuffix);
106 return app_name;
107}
108
[email protected]8ea8f1ef2013-01-06 18:39:03109// Gets expected app id for given Chrome (based on |command_line| and
110// |is_per_user_install|).
avi556c05022014-12-22 23:31:43111base::string16 GetExpectedAppId(const base::CommandLine& command_line,
[email protected]6a72a632013-12-12 22:22:00112 bool is_per_user_install) {
[email protected]b39e32e2013-04-24 08:55:54113 base::FilePath user_data_dir;
114 if (command_line.HasSwitch(switches::kUserDataDir))
115 user_data_dir = command_line.GetSwitchValuePath(switches::kUserDataDir);
116 else
117 chrome::GetDefaultUserDataDirectory(&user_data_dir);
[email protected]89d43832013-06-29 20:25:20118 // Adjust with any policy that overrides any other way to set the path.
119 policy::path_parser::CheckUserDataDirPolicy(&user_data_dir);
[email protected]b39e32e2013-04-24 08:55:54120 DCHECK(!user_data_dir.empty());
[email protected]c9bb06f42010-01-13 23:53:48121
[email protected]b39e32e2013-04-24 08:55:54122 base::FilePath profile_subdir;
123 if (command_line.HasSwitch(switches::kProfileDirectory)) {
124 profile_subdir =
125 command_line.GetSwitchValuePath(switches::kProfileDirectory);
126 } else {
[email protected]f911df52013-12-24 23:24:23127 profile_subdir =
128 base::FilePath(base::ASCIIToUTF16(chrome::kInitialProfile));
[email protected]b39e32e2013-04-24 08:55:54129 }
130 DCHECK(!profile_subdir.empty());
131
132 base::FilePath profile_path = user_data_dir.Append(profile_subdir);
[email protected]0085863a2013-12-06 21:19:03133 base::string16 app_name;
[email protected]c9bb06f42010-01-13 23:53:48134 if (command_line.HasSwitch(switches::kApp)) {
[email protected]f911df52013-12-24 23:24:23135 app_name = base::UTF8ToUTF16(web_app::GenerateApplicationNameFromURL(
[email protected]57ecc4b2010-08-11 03:02:51136 GURL(command_line.GetSwitchValueASCII(switches::kApp))));
[email protected]2f1c09d2011-01-14 14:58:14137 } else if (command_line.HasSwitch(switches::kAppId)) {
[email protected]f911df52013-12-24 23:24:23138 app_name = base::UTF8ToUTF16(
139 web_app::GenerateApplicationNameFromExtensionId(
140 command_line.GetSwitchValueASCII(switches::kAppId)));
taptedc2c690ab2016-05-25 02:49:03141 } else if (command_line.HasSwitch(switches::kShowAppList)) {
142 app_name = GetAppListAppName();
[email protected]c9bb06f42010-01-13 23:53:48143 } else {
grtc98803462017-03-08 10:05:08144 app_name = ShellUtil::GetBrowserModelId(is_per_user_install);
[email protected]c9bb06f42010-01-13 23:53:48145 }
[email protected]b39e32e2013-04-24 08:55:54146 DCHECK(!app_name.empty());
[email protected]c9bb06f42010-01-13 23:53:48147
pmonette9e4c1a82016-04-14 18:15:30148 return win::GetAppModelIdForProfile(app_name, profile_path);
[email protected]c9bb06f42010-01-13 23:53:48149}
150
gab88257b62016-01-15 03:19:19151void MigrateTaskbarPinsCallback() {
[email protected]3a3e72c2011-11-29 02:59:38152 // This should run on the file thread.
thestig00844cea2015-09-08 21:44:52153 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
[email protected]3a3e72c2011-11-29 02:59:38154
155 // Get full path of chrome.
[email protected]650b2d52013-02-10 03:41:45156 base::FilePath chrome_exe;
[email protected]3a3e72c2011-11-29 02:59:38157 if (!PathService::Get(base::FILE_EXE, &chrome_exe))
158 return;
159
gab88257b62016-01-15 03:19:19160 base::FilePath pins_path;
161 if (!PathService::Get(base::DIR_TASKBAR_PINS, &pins_path)) {
162 NOTREACHED();
163 return;
[email protected]3a3e72c2011-11-29 02:59:38164 }
gab88257b62016-01-15 03:19:19165
pmonette9e4c1a82016-04-14 18:15:30166 win::MigrateShortcutsInPathInternal(chrome_exe, pins_path);
[email protected]3a3e72c2011-11-29 02:59:38167}
168
[email protected]caa05352014-03-01 00:43:05169// Windows 8 introduced a new protocol->executable binding system which cannot
170// be retrieved in the HKCR registry subkey method implemented below. We call
171// AssocQueryString with the new Win8-only flag ASSOCF_IS_PROTOCOL instead.
172base::string16 GetAppForProtocolUsingAssocQuery(const GURL& url) {
thestig11bf74d2014-11-24 20:14:42173 base::string16 url_scheme = base::ASCIIToUTF16(url.scheme());
[email protected]caa05352014-03-01 00:43:05174 // Don't attempt to query protocol association on an empty string.
[email protected]6e84d372014-05-29 23:36:39175 if (url_scheme.empty())
[email protected]caa05352014-03-01 00:43:05176 return base::string16();
177
[email protected]caa05352014-03-01 00:43:05178 // Query AssocQueryString for a human-readable description of the program
179 // that will be invoked given the provided URL spec. This is used only to
180 // populate the external protocol dialog box the user sees when invoking
181 // an unknown external protocol.
182 wchar_t out_buffer[1024];
183 DWORD buffer_size = arraysize(out_buffer);
184 HRESULT hr = AssocQueryString(ASSOCF_IS_PROTOCOL,
185 ASSOCSTR_FRIENDLYAPPNAME,
[email protected]6e84d372014-05-29 23:36:39186 url_scheme.c_str(),
[email protected]caa05352014-03-01 00:43:05187 NULL,
188 out_buffer,
189 &buffer_size);
190 if (FAILED(hr)) {
191 DLOG(WARNING) << "AssocQueryString failed!";
192 return base::string16();
193 }
194 return base::string16(out_buffer);
195}
196
197base::string16 GetAppForProtocolUsingRegistry(const GURL& url) {
dominickn0c9a5062016-10-06 20:49:00198 base::string16 command_to_launch;
199
200 // First, try and extract the application's display name.
201 base::string16 cmd_key_path = base::ASCIIToUTF16(url.scheme());
202 base::win::RegKey cmd_key_name(HKEY_CLASSES_ROOT, cmd_key_path.c_str(),
203 KEY_READ);
204 if (cmd_key_name.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS &&
205 !command_to_launch.empty()) {
206 return command_to_launch;
[email protected]caa05352014-03-01 00:43:05207 }
dominickn0c9a5062016-10-06 20:49:00208
209 // Otherwise, parse the command line in the registry, and return the basename
210 // of the program path if it exists.
211 cmd_key_path = base::ASCIIToUTF16(url.scheme() + "\\shell\\open\\command");
212 base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(),
213 KEY_READ);
214 if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) {
215 base::CommandLine command_line(
216 base::CommandLine::FromString(command_to_launch));
217 return command_line.GetProgram().BaseName().value();
218 }
219
[email protected]caa05352014-03-01 00:43:05220 return base::string16();
221}
222
pmonette9fa59e882016-02-10 00:12:19223DefaultWebClientState GetDefaultWebClientStateFromShellUtilDefaultState(
224 ShellUtil::DefaultState default_state) {
[email protected]eb63da72012-10-15 20:39:48225 switch (default_state) {
226 case ShellUtil::NOT_DEFAULT:
pmonette9fa59e882016-02-10 00:12:19227 return DefaultWebClientState::NOT_DEFAULT;
[email protected]eb63da72012-10-15 20:39:48228 case ShellUtil::IS_DEFAULT:
pmonette9fa59e882016-02-10 00:12:19229 return DefaultWebClientState::IS_DEFAULT;
[email protected]eb63da72012-10-15 20:39:48230 default:
231 DCHECK_EQ(ShellUtil::UNKNOWN_DEFAULT, default_state);
pmonette9fa59e882016-02-10 00:12:19232 return DefaultWebClientState::UNKNOWN_DEFAULT;
[email protected]eb63da72012-10-15 20:39:48233 }
234}
235
grtc291eea2016-05-26 15:38:48236// A recorder of user actions in the Windows Settings app.
237class DefaultBrowserActionRecorder : public win::SettingsAppMonitor::Delegate {
238 public:
239 // Creates the recorder and the monitor that drives it. |continuation| will be
240 // run once the monitor's initialization completes (regardless of success or
241 // failure).
242 explicit DefaultBrowserActionRecorder(base::Closure continuation)
243 : continuation_(std::move(continuation)), settings_app_monitor_(this) {}
244
245 private:
246 // win::SettingsAppMonitor::Delegate:
247 void OnInitialized(HRESULT result) override {
248 UMA_HISTOGRAM_BOOLEAN("SettingsAppMonitor.InitializationResult",
249 SUCCEEDED(result));
250 if (SUCCEEDED(result)) {
251 base::RecordAction(
252 base::UserMetricsAction("SettingsAppMonitor.Initialized"));
253 }
254 continuation_.Run();
255 continuation_ = base::Closure();
256 }
257
258 void OnAppFocused() override {
259 base::RecordAction(
260 base::UserMetricsAction("SettingsAppMonitor.AppFocused"));
261 }
262
263 void OnChooserInvoked() override {
264 base::RecordAction(
265 base::UserMetricsAction("SettingsAppMonitor.ChooserInvoked"));
266 }
267
268 void OnBrowserChosen(const base::string16& browser_name) override {
269 if (browser_name ==
270 BrowserDistribution::GetDistribution()->GetDisplayName()) {
271 base::RecordAction(
272 base::UserMetricsAction("SettingsAppMonitor.ChromeBrowserChosen"));
273 } else {
274 base::RecordAction(
275 base::UserMetricsAction("SettingsAppMonitor.OtherBrowserChosen"));
276 }
277 }
278
pmonetteb66514b42016-12-07 20:28:39279 void OnPromoFocused() override {
280 base::RecordAction(
281 base::UserMetricsAction("SettingsAppMonitor.PromoFocused"));
282 }
283
284 void OnPromoChoiceMade(bool accept_promo) override {
285 if (accept_promo) {
286 base::RecordAction(
287 base::UserMetricsAction("SettingsAppMonitor.CheckItOut"));
288 } else {
289 base::RecordAction(
290 base::UserMetricsAction("SettingsAppMonitor.SwitchAnyway"));
291 }
292 }
293
grtc291eea2016-05-26 15:38:48294 // A closure to be run once initialization completes.
295 base::Closure continuation_;
296
297 // Monitors user interaction with the Windows Settings app for the sake of
298 // reporting user actions.
299 win::SettingsAppMonitor settings_app_monitor_;
300
301 DISALLOW_COPY_AND_ASSIGN(DefaultBrowserActionRecorder);
302};
303
304// A function bound up in a callback with a DefaultBrowserActionRecorder and
305// a closure to keep the former alive until the time comes to run the latter.
306void OnSettingsAppFinished(
307 std::unique_ptr<DefaultBrowserActionRecorder> recorder,
308 const base::Closure& on_finished_callback) {
309 recorder.reset();
310 on_finished_callback.Run();
311}
312
pmonette32a5cfb42016-04-11 22:04:44313// There is no way to make sure the user is done with the system settings, but a
314// signal that the interaction is finished is needed for UMA. A timer of 2
315// minutes is used as a substitute. The registry keys for the protocol
316// association with an app are also monitored to signal the end of the
317// interaction early when it is clear that the user made a choice (e.g. http
318// and https for default browser).
319//
320// This helper class manages both the timer and the registry watchers and makes
321// sure the callback for the end of the settings interaction is only run once.
322// This class also manages its own lifetime.
323class OpenSystemSettingsHelper {
324 public:
325 // Begin the monitoring and will call |on_finished_callback| when done.
326 // Takes in a null-terminated array of |protocols| whose registry keys must be
pmonette0c40087a2016-04-21 00:05:16327 // watched. The array must contain at least one element.
pmonette32a5cfb42016-04-11 22:04:44328 static void Begin(const wchar_t* const protocols[],
329 const base::Closure& on_finished_callback) {
pmonettec541d942016-06-15 22:08:32330 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
331
332 delete instance_;
333 instance_ = new OpenSystemSettingsHelper(protocols, on_finished_callback);
pmonette32a5cfb42016-04-11 22:04:44334 }
335
336 private:
337 // The reason the settings interaction concluded. Do not modify the ordering
338 // because it is used for UMA.
339 enum ConcludeReason { REGISTRY_WATCHER, TIMEOUT, NUM_CONCLUDE_REASON_TYPES };
340
341 OpenSystemSettingsHelper(const wchar_t* const protocols[],
342 const base::Closure& on_finished_callback)
pmonette0c40087a2016-04-21 00:05:16343 : scoped_user_protocol_entry_(protocols[0]),
344 on_finished_callback_(on_finished_callback),
345 weak_ptr_factory_(this) {
pmonette32a5cfb42016-04-11 22:04:44346 static const wchar_t kUrlAssociationFormat[] =
347 L"SOFTWARE\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\"
348 L"%ls\\UserChoice";
349
350 // Remember the start time.
351 start_time_ = base::TimeTicks::Now();
352
353 for (const wchar_t* const* scan = &protocols[0]; *scan != nullptr; ++scan) {
354 AddRegistryKeyWatcher(
355 base::StringPrintf(kUrlAssociationFormat, *scan).c_str());
356 }
357 // Only the watchers that were succesfully initialized are counted.
358 registry_watcher_count_ = registry_key_watchers_.size();
359
360 timer_.Start(
361 FROM_HERE, base::TimeDelta::FromMinutes(2),
362 base::Bind(&OpenSystemSettingsHelper::ConcludeInteraction,
363 weak_ptr_factory_.GetWeakPtr(), ConcludeReason::TIMEOUT));
364 }
365
366 // Called when a change is detected on one of the registry keys being watched.
367 // Note: All types of modification to the registry key will trigger this
368 // function even if the value change is the only one that matters. This
369 // is good enough for now.
370 void OnRegistryKeyChanged() {
371 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
372
373 // Make sure all the registry watchers have fired.
374 if (--registry_watcher_count_ == 0) {
375 UMA_HISTOGRAM_MEDIUM_TIMES(
376 "DefaultBrowser.SettingsInteraction.RegistryWatcherDuration",
377 base::TimeTicks::Now() - start_time_);
378
379 ConcludeInteraction(ConcludeReason::REGISTRY_WATCHER);
380 }
381 }
382
383 // Ends the monitoring with the system settings. Will call
384 // |on_finished_callback_| and then dispose of this class instance to make
385 // sure the callback won't get called subsequently.
386 void ConcludeInteraction(ConcludeReason conclude_reason) {
387 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
388
389 UMA_HISTOGRAM_ENUMERATION(
390 "DefaultBrowser.SettingsInteraction.ConcludeReason", conclude_reason,
391 NUM_CONCLUDE_REASON_TYPES);
392 on_finished_callback_.Run();
pmonettec541d942016-06-15 22:08:32393 delete instance_;
394 instance_ = nullptr;
pmonette32a5cfb42016-04-11 22:04:44395 }
396
397 // Helper function to create a registry watcher for a given |key_path|. Do
398 // nothing on initialization failure.
399 void AddRegistryKeyWatcher(const wchar_t* key_path) {
ricea86fa1dd2016-09-13 05:59:45400 auto reg_key = base::MakeUnique<base::win::RegKey>(HKEY_CURRENT_USER,
401 key_path, KEY_NOTIFY);
pmonette32a5cfb42016-04-11 22:04:44402
403 if (reg_key->Valid() &&
404 reg_key->StartWatching(
405 base::Bind(&OpenSystemSettingsHelper::OnRegistryKeyChanged,
406 weak_ptr_factory_.GetWeakPtr()))) {
407 registry_key_watchers_.push_back(std::move(reg_key));
408 }
409 }
410
pmonettec541d942016-06-15 22:08:32411 // Used to make sure only one instance is alive at the same time.
412 static OpenSystemSettingsHelper* instance_;
413
pmonette0c40087a2016-04-21 00:05:16414 // This is needed to make sure that Windows displays an entry for the protocol
415 // inside the "Choose default apps by protocol" settings page.
416 ScopedUserProtocolEntry scoped_user_protocol_entry_;
417
pmonette32a5cfb42016-04-11 22:04:44418 // The function to call when the interaction with the system settings is
419 // finished.
420 base::Closure on_finished_callback_;
421
422 // The number of time the registry key watchers must fire.
423 int registry_watcher_count_ = 0;
424
425 // There can be multiple registry key watchers as some settings modify
426 // multiple protocol associations. e.g. Changing the default browser modifies
427 // the http and https associations.
dcheng4af48582016-04-19 00:29:35428 std::vector<std::unique_ptr<base::win::RegKey>> registry_key_watchers_;
pmonette32a5cfb42016-04-11 22:04:44429
430 base::OneShotTimer timer_;
431
432 // Records the time it takes for the final registry watcher to get signaled.
433 base::TimeTicks start_time_;
434
435 // Weak ptrs are used to bind this class to the callbacks of the timer and the
436 // registry watcher. This makes it possible to self-delete after one of the
437 // callbacks is executed to cancel the remaining ones.
438 base::WeakPtrFactory<OpenSystemSettingsHelper> weak_ptr_factory_;
439
440 DISALLOW_COPY_AND_ASSIGN(OpenSystemSettingsHelper);
441};
442
pmonettec541d942016-06-15 22:08:32443OpenSystemSettingsHelper* OpenSystemSettingsHelper::instance_ = nullptr;
444
pmonettea98315242016-11-23 21:39:18445// Helper class to determine if Chrome is pinned to the taskbar. Hides the
446// complexity of managing the lifetime of a UtilityProcessMojoClient.
447class IsPinnedToTaskbarHelper {
448 public:
449 using ResultCallback = win::IsPinnedToTaskbarCallback;
450 using ErrorCallback = win::ConnectionErrorCallback;
451 static void GetState(const ErrorCallback& error_callback,
452 const ResultCallback& result_callback);
453
454 private:
455 IsPinnedToTaskbarHelper(const ErrorCallback& error_callback,
456 const ResultCallback& result_callback);
457
458 void OnConnectionError();
459 void OnIsPinnedToTaskbarResult(bool succeeded, bool is_pinned_to_taskbar);
460
461 content::UtilityProcessMojoClient<chrome::mojom::ShellHandler> shell_handler_;
462
463 ErrorCallback error_callback_;
464 ResultCallback result_callback_;
465
466 DISALLOW_COPY_AND_ASSIGN(IsPinnedToTaskbarHelper);
467};
468
469// static
470void IsPinnedToTaskbarHelper::GetState(const ErrorCallback& error_callback,
471 const ResultCallback& result_callback) {
472 // Self-deleting when the ShellHandler completes.
473 new IsPinnedToTaskbarHelper(error_callback, result_callback);
pmonette5057ca3b2016-07-04 16:48:40474}
475
pmonettea98315242016-11-23 21:39:18476IsPinnedToTaskbarHelper::IsPinnedToTaskbarHelper(
477 const ErrorCallback& error_callback,
478 const ResultCallback& result_callback)
479 : shell_handler_(
480 l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_SHELL_HANDLER_NAME)),
481 error_callback_(error_callback),
482 result_callback_(result_callback) {
pmonette83edc1e2016-12-15 17:36:44483 DCHECK(error_callback_);
484 DCHECK(result_callback_);
485
pmonettea98315242016-11-23 21:39:18486 // |shell_handler_| owns the callbacks and is guaranteed to be destroyed
487 // before |this|, therefore making base::Unretained() safe to use.
488 shell_handler_.set_error_callback(base::Bind(
489 &IsPinnedToTaskbarHelper::OnConnectionError, base::Unretained(this)));
490 shell_handler_.set_disable_sandbox();
491 shell_handler_.Start();
492
493 shell_handler_.service()->IsPinnedToTaskbar(
494 base::Bind(&IsPinnedToTaskbarHelper::OnIsPinnedToTaskbarResult,
495 base::Unretained(this)));
496}
497
498void IsPinnedToTaskbarHelper::OnConnectionError() {
499 error_callback_.Run();
500 delete this;
501}
502
503void IsPinnedToTaskbarHelper::OnIsPinnedToTaskbarResult(
pmonette5057ca3b2016-07-04 16:48:40504 bool succeeded,
505 bool is_pinned_to_taskbar) {
pmonettea98315242016-11-23 21:39:18506 result_callback_.Run(succeeded, is_pinned_to_taskbar);
507 delete this;
pmonette5057ca3b2016-07-04 16:48:40508}
509
[email protected]3a3e72c2011-11-29 02:59:38510} // namespace
[email protected]12f520c2010-01-06 18:11:15511
pmonette9fa59e882016-02-10 00:12:19512bool SetAsDefaultBrowser() {
[email protected]650b2d52013-02-10 03:41:45513 base::FilePath chrome_exe;
[email protected]d24c4012009-07-28 01:57:31514 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
515 LOG(ERROR) << "Error getting app exe path";
516 return false;
517 }
518
519 // From UI currently we only allow setting default browser for current user.
[email protected]bf6117c7e2010-12-01 06:00:25520 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
grte76ca2852014-12-05 16:42:10521 if (!ShellUtil::MakeChromeDefault(dist, ShellUtil::CURRENT_USER, chrome_exe,
522 true /* elevate_if_not_admin */)) {
[email protected]d24c4012009-07-28 01:57:31523 LOG(ERROR) << "Chrome could not be set as default browser.";
524 return false;
525 }
526
[email protected]8e96e502010-10-21 20:57:12527 VLOG(1) << "Chrome registered as default browser.";
[email protected]d24c4012009-07-28 01:57:31528 return true;
529}
530
pmonette9fa59e882016-02-10 00:12:19531bool SetAsDefaultProtocolClient(const std::string& protocol) {
[email protected]4468a5b2011-05-26 07:48:02532 if (protocol.empty())
533 return false;
534
[email protected]650b2d52013-02-10 03:41:45535 base::FilePath chrome_exe;
[email protected]4468a5b2011-05-26 07:48:02536 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
537 LOG(ERROR) << "Error getting app exe path";
538 return false;
539 }
540
[email protected]f911df52013-12-24 23:24:23541 base::string16 wprotocol(base::UTF8ToUTF16(protocol));
[email protected]4468a5b2011-05-26 07:48:02542 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
grte76ca2852014-12-05 16:42:10543 if (!ShellUtil::MakeChromeDefaultProtocolClient(dist, chrome_exe,
544 wprotocol)) {
[email protected]4468a5b2011-05-26 07:48:02545 LOG(ERROR) << "Chrome could not be set as default handler for "
546 << protocol << ".";
547 return false;
548 }
549
550 VLOG(1) << "Chrome registered as default handler for " << protocol << ".";
551 return true;
552}
553
pmonette32a5cfb42016-04-11 22:04:44554DefaultWebClientSetPermission GetDefaultWebClientSetPermission() {
grt509bc942017-03-25 08:43:21555 if (!install_static::SupportsSetAsDefaultBrowser())
pmonette034a03d92015-10-02 21:04:27556 return SET_DEFAULT_NOT_ALLOWED;
pmonette034a03d92015-10-02 21:04:27557 if (ShellUtil::CanMakeChromeDefaultUnattended())
558 return SET_DEFAULT_UNATTENDED;
pmonette32a5cfb42016-04-11 22:04:44559 // Windows 8 and 10 both introduced a new way to set the default web client
560 // which require user interaction.
pmonettef89ac7c72015-10-06 03:22:01561 return SET_DEFAULT_INTERACTIVE;
pmonette034a03d92015-10-02 21:04:27562}
563
pmonette9fa59e882016-02-10 00:12:19564bool IsElevationNeededForSettingDefaultProtocolClient() {
pmonette868ca642015-09-02 14:34:02565 return base::win::GetVersion() < base::win::VERSION_WIN8;
566}
567
pmonette9fa59e882016-02-10 00:12:19568base::string16 GetApplicationNameForProtocol(const GURL& url) {
benwellsd0c67aa2016-07-28 02:57:20569 base::string16 application_name;
570 // Windows 8 or above has a new protocol association query.
571 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
572 application_name = GetAppForProtocolUsingAssocQuery(url);
573 if (!application_name.empty())
574 return application_name;
575 }
576
577 return GetAppForProtocolUsingRegistry(url);
[email protected]42dc9402013-01-30 07:54:20578}
579
pmonette9fa59e882016-02-10 00:12:19580DefaultWebClientState GetDefaultBrowser() {
pmonette034a03d92015-10-02 21:04:27581 return GetDefaultWebClientStateFromShellUtilDefaultState(
582 ShellUtil::GetChromeDefaultState());
583}
584
[email protected]d24c4012009-07-28 01:57:31585// There is no reliable way to say which browser is default on a machine (each
586// browser can have some of the protocols/shortcuts). So we look for only HTTP
587// protocol handler. Even this handler is located at different places in
588// registry on XP and Vista:
589// - HKCR\http\shell\open\command (XP)
590// - HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\
591// http\UserChoice (Vista)
thakise4a02ff32016-09-20 17:00:42592// This method checks if Firefox is default browser by checking these
[email protected]d24c4012009-07-28 01:57:31593// locations and returns true if Firefox traces are found there. In case of
594// error (or if Firefox is not found)it returns the default value which
595// is false.
pmonette9fa59e882016-02-10 00:12:19596bool IsFirefoxDefaultBrowser() {
[email protected]d24c4012009-07-28 01:57:31597 bool ff_default = false;
[email protected]935aa542010-10-15 01:59:15598 if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
[email protected]0085863a2013-12-06 21:19:03599 base::string16 app_cmd;
[email protected]2d6503982010-10-17 04:41:54600 base::win::RegKey key(HKEY_CURRENT_USER,
601 ShellUtil::kRegVistaUrlPrefs, KEY_READ);
[email protected]e06f4d52011-01-19 07:28:46602 if (key.Valid() && (key.ReadValue(L"Progid", &app_cmd) == ERROR_SUCCESS) &&
[email protected]d24c4012009-07-28 01:57:31603 app_cmd == L"FirefoxURL")
604 ff_default = true;
605 } else {
[email protected]0085863a2013-12-06 21:19:03606 base::string16 key_path(L"http");
[email protected]d24c4012009-07-28 01:57:31607 key_path.append(ShellUtil::kRegShellOpen);
[email protected]2d6503982010-10-17 04:41:54608 base::win::RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ);
[email protected]0085863a2013-12-06 21:19:03609 base::string16 app_cmd;
[email protected]e06f4d52011-01-19 07:28:46610 if (key.Valid() && (key.ReadValue(L"", &app_cmd) == ERROR_SUCCESS) &&
[email protected]cb1f4ac2014-08-07 16:55:42611 base::string16::npos !=
brettwfce8d192015-08-10 19:07:51612 base::ToLowerASCII(app_cmd).find(L"firefox"))
[email protected]d24c4012009-07-28 01:57:31613 ff_default = true;
614 }
615 return ff_default;
616}
[email protected]12f520c2010-01-06 18:11:15617
pmonette9fa59e882016-02-10 00:12:19618DefaultWebClientState IsDefaultProtocolClient(const std::string& protocol) {
pmonette034a03d92015-10-02 21:04:27619 return GetDefaultWebClientStateFromShellUtilDefaultState(
620 ShellUtil::GetChromeDefaultProtocolClientState(
621 base::UTF8ToUTF16(protocol)));
622}
623
pmonette9e4c1a82016-04-14 18:15:30624namespace win {
625
626bool SetAsDefaultBrowserUsingIntentPicker() {
627 base::FilePath chrome_exe;
628 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
629 NOTREACHED() << "Error getting app exe path";
630 return false;
631 }
632
633 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
634 if (!ShellUtil::ShowMakeChromeDefaultSystemUI(dist, chrome_exe)) {
635 LOG(ERROR) << "Failed to launch the set-default-browser Windows UI.";
636 return false;
637 }
638
639 VLOG(1) << "Set-default-browser Windows UI completed.";
640 return true;
641}
642
643void SetAsDefaultBrowserUsingSystemSettings(
644 const base::Closure& on_finished_callback) {
645 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
646
647 base::FilePath chrome_exe;
648 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
649 NOTREACHED() << "Error getting app exe path";
650 on_finished_callback.Run();
651 return;
652 }
653
grtc291eea2016-05-26 15:38:48654 // Create an action recorder that will open the settings app once it has
655 // initialized.
656 std::unique_ptr<DefaultBrowserActionRecorder> recorder(
657 new DefaultBrowserActionRecorder(base::Bind(
658 base::IgnoreResult(&ShellUtil::ShowMakeChromeDefaultSystemUI),
659 base::Unretained(BrowserDistribution::GetDistribution()),
660 chrome_exe)));
pmonette9e4c1a82016-04-14 18:15:30661
grtc291eea2016-05-26 15:38:48662 // The helper manages its own lifetime. Bind the action recorder
663 // into the finished callback to keep it alive throughout the
664 // interaction.
665 static const wchar_t* const kProtocols[] = {L"http", L"https", nullptr};
666 OpenSystemSettingsHelper::Begin(
667 kProtocols, base::Bind(&OnSettingsAppFinished, base::Passed(&recorder),
668 on_finished_callback));
pmonette9e4c1a82016-04-14 18:15:30669}
670
671bool SetAsDefaultProtocolClientUsingIntentPicker(const std::string& protocol) {
672 base::FilePath chrome_exe;
673 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
674 NOTREACHED() << "Error getting app exe path";
675 return false;
676 }
677
678 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
679 base::string16 wprotocol(base::UTF8ToUTF16(protocol));
680 if (!ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI(dist, chrome_exe,
681 wprotocol)) {
682 LOG(ERROR) << "Failed to launch the set-default-client Windows UI.";
683 return false;
684 }
685
686 VLOG(1) << "Set-default-client Windows UI completed.";
687 return true;
688}
689
pmonette0c40087a2016-04-21 00:05:16690void SetAsDefaultProtocolClientUsingSystemSettings(
691 const std::string& protocol,
692 const base::Closure& on_finished_callback) {
693 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
694
695 base::FilePath chrome_exe;
696 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
697 NOTREACHED() << "Error getting app exe path";
698 on_finished_callback.Run();
699 return;
700 }
701
702 // The helper manages its own lifetime.
703 base::string16 wprotocol(base::UTF8ToUTF16(protocol));
704 const wchar_t* const kProtocols[] = {wprotocol.c_str(), nullptr};
705 OpenSystemSettingsHelper::Begin(kProtocols, on_finished_callback);
706
707 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
708 ShellUtil::ShowMakeChromeDefaultProtocolClientSystemUI(dist, chrome_exe,
709 wprotocol);
710}
711
pmonette9fa59e882016-02-10 00:12:19712base::string16 GetAppModelIdForProfile(const base::string16& app_name,
713 const base::FilePath& profile_path) {
[email protected]d2065e062013-12-12 23:49:52714 std::vector<base::string16> components;
[email protected]a0448002012-06-19 04:32:10715 components.push_back(app_name);
[email protected]0085863a2013-12-06 21:19:03716 const base::string16 profile_id(GetProfileIdFromPath(profile_path));
[email protected]a0448002012-06-19 04:32:10717 if (!profile_id.empty())
718 components.push_back(profile_id);
719 return ShellUtil::BuildAppModelId(components);
[email protected]12f520c2010-01-06 18:11:15720}
721
pmonette9fa59e882016-02-10 00:12:19722base::string16 GetChromiumModelIdForProfile(
[email protected]650b2d52013-02-10 03:41:45723 const base::FilePath& profile_path) {
[email protected]a0448002012-06-19 04:32:10724 return GetAppModelIdForProfile(
grtc98803462017-03-08 10:05:08725 ShellUtil::GetBrowserModelId(InstallUtil::IsPerUserInstall()),
[email protected]786799692012-09-26 14:16:48726 profile_path);
[email protected]12f520c2010-01-06 18:11:15727}
[email protected]c9bb06f42010-01-13 23:53:48728
pmonette9fa59e882016-02-10 00:12:19729void MigrateTaskbarPins() {
[email protected]935aa542010-10-15 01:59:15730 if (base::win::GetVersion() < base::win::VERSION_WIN7)
[email protected]c9bb06f42010-01-13 23:53:48731 return;
732
[email protected]81fcf952012-11-26 22:25:14733 // This needs to happen eventually (e.g. so that the appid is fixed and the
734 // run-time Chrome icon is merged with the taskbar shortcut), but this is not
735 // urgent and shouldn't delay Chrome startup.
gab88257b62016-01-15 03:19:19736 static const int64_t kMigrateTaskbarPinsDelaySeconds = 15;
[email protected]81fcf952012-11-26 22:25:14737 BrowserThread::PostDelayedTask(
[email protected]3a3e72c2011-11-29 02:59:38738 BrowserThread::FILE, FROM_HERE,
gab88257b62016-01-15 03:19:19739 base::Bind(&MigrateTaskbarPinsCallback),
740 base::TimeDelta::FromSeconds(kMigrateTaskbarPinsDelaySeconds));
[email protected]c9bb06f42010-01-13 23:53:48741}
[email protected]43903b82012-06-01 05:26:23742
pmonettea98315242016-11-23 21:39:18743void GetIsPinnedToTaskbarState(
744 const ConnectionErrorCallback& on_error_callback,
745 const IsPinnedToTaskbarCallback& result_callback) {
746 IsPinnedToTaskbarHelper::GetState(on_error_callback, result_callback);
pmonette5057ca3b2016-07-04 16:48:40747}
748
pmonette9fa59e882016-02-10 00:12:19749int MigrateShortcutsInPathInternal(const base::FilePath& chrome_exe,
750 const base::FilePath& path) {
[email protected]8ea8f1ef2013-01-06 18:39:03751 DCHECK(base::win::GetVersion() >= base::win::VERSION_WIN7);
752
753 // Enumerate all pinned shortcuts in the given path directly.
[email protected]25a4c1c2013-06-08 04:53:36754 base::FileEnumerator shortcuts_enum(
[email protected]8ea8f1ef2013-01-06 18:39:03755 path, false, // not recursive
[email protected]25a4c1c2013-06-08 04:53:36756 base::FileEnumerator::FILES, FILE_PATH_LITERAL("*.lnk"));
[email protected]8ea8f1ef2013-01-06 18:39:03757
grt973412f2017-02-25 08:04:21758 bool is_per_user_install = InstallUtil::IsPerUserInstall();
[email protected]8ea8f1ef2013-01-06 18:39:03759
760 int shortcuts_migrated = 0;
[email protected]650b2d52013-02-10 03:41:45761 base::FilePath target_path;
[email protected]0085863a2013-12-06 21:19:03762 base::string16 arguments;
[email protected]07983302013-01-21 19:41:44763 base::win::ScopedPropVariant propvariant;
[email protected]650b2d52013-02-10 03:41:45764 for (base::FilePath shortcut = shortcuts_enum.Next(); !shortcut.empty();
[email protected]8ea8f1ef2013-01-06 18:39:03765 shortcut = shortcuts_enum.Next()) {
766 // TODO(gab): Use ProgramCompare instead of comparing FilePaths below once
767 // it is fixed to work with FilePaths with spaces.
768 if (!base::win::ResolveShortcut(shortcut, &target_path, &arguments) ||
769 chrome_exe != target_path) {
770 continue;
771 }
avi556c05022014-12-22 23:31:43772 base::CommandLine command_line(
773 base::CommandLine::FromString(base::StringPrintf(
774 L"\"%ls\" %ls", target_path.value().c_str(), arguments.c_str())));
[email protected]8ea8f1ef2013-01-06 18:39:03775
776 // Get the expected AppId for this Chrome shortcut.
[email protected]0085863a2013-12-06 21:19:03777 base::string16 expected_app_id(
[email protected]8ea8f1ef2013-01-06 18:39:03778 GetExpectedAppId(command_line, is_per_user_install));
779 if (expected_app_id.empty())
780 continue;
781
782 // Load the shortcut.
783 base::win::ScopedComPtr<IShellLink> shell_link;
784 base::win::ScopedComPtr<IPersistFile> persist_file;
785 if (FAILED(shell_link.CreateInstance(CLSID_ShellLink, NULL,
786 CLSCTX_INPROC_SERVER)) ||
dcheng81762e02014-11-21 21:22:28787 FAILED(persist_file.QueryFrom(shell_link.get())) ||
[email protected]8ea8f1ef2013-01-06 18:39:03788 FAILED(persist_file->Load(shortcut.value().c_str(), STGM_READ))) {
789 DLOG(WARNING) << "Failed loading shortcut at " << shortcut.value();
790 continue;
791 }
792
793 // Any properties that need to be updated on the shortcut will be stored in
794 // |updated_properties|.
795 base::win::ShortcutProperties updated_properties;
796
797 // Validate the existing app id for the shortcut.
798 base::win::ScopedComPtr<IPropertyStore> property_store;
[email protected]07983302013-01-21 19:41:44799 propvariant.Reset();
dcheng81762e02014-11-21 21:22:28800 if (FAILED(property_store.QueryFrom(shell_link.get())) ||
801 property_store->GetValue(PKEY_AppUserModel_ID, propvariant.Receive()) !=
802 S_OK) {
[email protected]8ea8f1ef2013-01-06 18:39:03803 // When in doubt, prefer not updating the shortcut.
804 NOTREACHED();
805 continue;
[email protected]8ea8f1ef2013-01-06 18:39:03806 } else {
[email protected]07983302013-01-21 19:41:44807 switch (propvariant.get().vt) {
808 case VT_EMPTY:
809 // If there is no app_id set, set our app_id if one is expected.
810 if (!expected_app_id.empty())
811 updated_properties.set_app_id(expected_app_id);
812 break;
813 case VT_LPWSTR:
[email protected]0085863a2013-12-06 21:19:03814 if (expected_app_id != base::string16(propvariant.get().pwszVal))
[email protected]07983302013-01-21 19:41:44815 updated_properties.set_app_id(expected_app_id);
816 break;
817 default:
818 NOTREACHED();
819 continue;
[email protected]8ea8f1ef2013-01-06 18:39:03820 }
821 }
822
gab88257b62016-01-15 03:19:19823 // Clear dual_mode property from any shortcuts that previously had it (it
824 // was only ever installed on shortcuts with the
825 // |default_chromium_model_id|).
[email protected]0085863a2013-12-06 21:19:03826 base::string16 default_chromium_model_id(
grtc98803462017-03-08 10:05:08827 ShellUtil::GetBrowserModelId(is_per_user_install));
gab88257b62016-01-15 03:19:19828 if (expected_app_id == default_chromium_model_id) {
[email protected]07983302013-01-21 19:41:44829 propvariant.Reset();
[email protected]8ea8f1ef2013-01-06 18:39:03830 if (property_store->GetValue(PKEY_AppUserModel_IsDualMode,
[email protected]07983302013-01-21 19:41:44831 propvariant.Receive()) != S_OK) {
[email protected]8ea8f1ef2013-01-06 18:39:03832 // When in doubt, prefer to not update the shortcut.
833 NOTREACHED();
834 continue;
gab38d242d4d2016-01-14 20:38:12835 }
836 if (propvariant.get().vt == VT_BOOL &&
837 !!propvariant.get().boolVal) {
838 updated_properties.set_dual_mode(false);
[email protected]8ea8f1ef2013-01-06 18:39:03839 }
840 }
841
robliao9212cb42017-04-06 17:43:39842 persist_file.Reset();
843 shell_link.Reset();
[email protected]8ea8f1ef2013-01-06 18:39:03844
845 // Update the shortcut if some of its properties need to be updated.
846 if (updated_properties.options &&
847 base::win::CreateOrUpdateShortcutLink(
848 shortcut, updated_properties,
849 base::win::SHORTCUT_UPDATE_EXISTING)) {
850 ++shortcuts_migrated;
851 }
852 }
853 return shortcuts_migrated;
854}
855
pmonette32a5cfb42016-04-11 22:04:44856} // namespace win
857
pmonette9fa59e882016-02-10 00:12:19858} // namespace shell_integration