OLD | NEW |
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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shlwapi.h> | 8 #include <shlwapi.h> |
9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
10 #include <propkey.h> // Needs to come after shobjidl.h. | 10 #include <propkey.h> // Needs to come after shobjidl.h. |
| 11 #include <stddef.h> |
| 12 #include <stdint.h> |
11 | 13 |
12 #include "base/bind.h" | 14 #include "base/bind.h" |
13 #include "base/command_line.h" | 15 #include "base/command_line.h" |
14 #include "base/files/file_enumerator.h" | 16 #include "base/files/file_enumerator.h" |
15 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
| 18 #include "base/macros.h" |
16 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
17 #include "base/metrics/histogram_macros.h" | 20 #include "base/metrics/histogram_macros.h" |
18 #include "base/path_service.h" | 21 #include "base/path_service.h" |
19 #include "base/process/launch.h" | 22 #include "base/process/launch.h" |
20 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
22 #include "base/strings/stringprintf.h" | 25 #include "base/strings/stringprintf.h" |
23 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
24 #include "base/timer/timer.h" | 27 #include "base/timer/timer.h" |
25 #include "base/win/registry.h" | 28 #include "base/win/registry.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 return GetAppModelIdForProfile(GetAppListAppName(), profile_path); | 465 return GetAppModelIdForProfile(GetAppListAppName(), profile_path); |
463 } | 466 } |
464 | 467 |
465 void ShellIntegration::MigrateChromiumShortcuts() { | 468 void ShellIntegration::MigrateChromiumShortcuts() { |
466 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 469 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
467 return; | 470 return; |
468 | 471 |
469 // This needs to happen eventually (e.g. so that the appid is fixed and the | 472 // This needs to happen eventually (e.g. so that the appid is fixed and the |
470 // run-time Chrome icon is merged with the taskbar shortcut), but this is not | 473 // run-time Chrome icon is merged with the taskbar shortcut), but this is not |
471 // urgent and shouldn't delay Chrome startup. | 474 // urgent and shouldn't delay Chrome startup. |
472 static const int64 kMigrateChromiumShortcutsDelaySeconds = 15; | 475 static const int64_t kMigrateChromiumShortcutsDelaySeconds = 15; |
473 BrowserThread::PostDelayedTask( | 476 BrowserThread::PostDelayedTask( |
474 BrowserThread::FILE, FROM_HERE, | 477 BrowserThread::FILE, FROM_HERE, |
475 base::Bind(&MigrateChromiumShortcutsCallback), | 478 base::Bind(&MigrateChromiumShortcutsCallback), |
476 base::TimeDelta::FromSeconds(kMigrateChromiumShortcutsDelaySeconds)); | 479 base::TimeDelta::FromSeconds(kMigrateChromiumShortcutsDelaySeconds)); |
477 } | 480 } |
478 | 481 |
479 int ShellIntegration::MigrateShortcutsInPathInternal( | 482 int ShellIntegration::MigrateShortcutsInPathInternal( |
480 const base::FilePath& chrome_exe, | 483 const base::FilePath& chrome_exe, |
481 const base::FilePath& path, | 484 const base::FilePath& path, |
482 bool check_dual_mode) { | 485 bool check_dual_mode) { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 // in the "How would you like to open this?" prompt. | 688 // in the "How would you like to open this?" prompt. |
686 if (!RegisterBrowser()) | 689 if (!RegisterBrowser()) |
687 return false; | 690 return false; |
688 | 691 |
689 ResetDefaultBrowser(); | 692 ResetDefaultBrowser(); |
690 | 693 |
691 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); | 694 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); |
692 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); | 695 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); |
693 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); | 696 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); |
694 } | 697 } |
OLD | NEW |