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 // This file defines functions that integrate Chrome in Windows shell. These | 5 // This file defines functions that integrate Chrome in Windows shell. These |
6 // functions can be used by Chrome as well as Chrome installer. All of the | 6 // functions can be used by Chrome as well as Chrome installer. All of the |
7 // work is done by the local functions defined in anonymous namespace in | 7 // work is done by the local functions defined in anonymous namespace in |
8 // this class. | 8 // this class. |
9 | 9 |
10 #include "chrome/installer/util/shell_util.h" | 10 #include "chrome/installer/util/shell_util.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "base/synchronization/cancellation_flag.h" | 36 #include "base/synchronization/cancellation_flag.h" |
37 #include "base/values.h" | 37 #include "base/values.h" |
38 #include "base/win/registry.h" | 38 #include "base/win/registry.h" |
39 #include "base/win/scoped_co_mem.h" | 39 #include "base/win/scoped_co_mem.h" |
40 #include "base/win/scoped_comptr.h" | 40 #include "base/win/scoped_comptr.h" |
41 #include "base/win/shortcut.h" | 41 #include "base/win/shortcut.h" |
42 #include "base/win/win_util.h" | 42 #include "base/win/win_util.h" |
43 #include "base/win/windows_version.h" | 43 #include "base/win/windows_version.h" |
44 #include "chrome/common/chrome_constants.h" | 44 #include "chrome/common/chrome_constants.h" |
45 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/installer/util/beacons.h" |
46 #include "chrome/installer/util/browser_distribution.h" | 47 #include "chrome/installer/util/browser_distribution.h" |
47 #include "chrome/installer/util/install_util.h" | 48 #include "chrome/installer/util/install_util.h" |
48 #include "chrome/installer/util/installer_util_strings.h" | 49 #include "chrome/installer/util/installer_util_strings.h" |
49 #include "chrome/installer/util/l10n_string_util.h" | 50 #include "chrome/installer/util/l10n_string_util.h" |
50 #include "chrome/installer/util/master_preferences.h" | 51 #include "chrome/installer/util/master_preferences.h" |
51 #include "chrome/installer/util/master_preferences_constants.h" | 52 #include "chrome/installer/util/master_preferences_constants.h" |
52 #include "chrome/installer/util/util_constants.h" | 53 #include "chrome/installer/util/util_constants.h" |
53 #include "chrome/installer/util/work_item.h" | 54 #include "chrome/installer/util/work_item.h" |
54 | 55 |
55 using base::win::RegKey; | 56 using base::win::RegKey; |
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 // When we check for default browser we don't necessarily want to count file | 1957 // When we check for default browser we don't necessarily want to count file |
1957 // type handlers and icons as having changed the default browser status, | 1958 // type handlers and icons as having changed the default browser status, |
1958 // since the user may have changed their shell settings to cause HTML files | 1959 // since the user may have changed their shell settings to cause HTML files |
1959 // to open with a text editor for example. We also don't want to aggressively | 1960 // to open with a text editor for example. We also don't want to aggressively |
1960 // claim FTP, since the user may have a separate FTP client. It is an open | 1961 // claim FTP, since the user may have a separate FTP client. It is an open |
1961 // question as to how to "heal" these settings. Perhaps the user should just | 1962 // question as to how to "heal" these settings. Perhaps the user should just |
1962 // re-run the installer or run with the --set-default-browser command line | 1963 // re-run the installer or run with the --set-default-browser command line |
1963 // flag. There is doubtless some other key we can hook into to cause "Repair" | 1964 // flag. There is doubtless some other key we can hook into to cause "Repair" |
1964 // to show up in Add/Remove programs for us. | 1965 // to show up in Add/Remove programs for us. |
1965 static const wchar_t* const kChromeProtocols[] = { L"http", L"https" }; | 1966 static const wchar_t* const kChromeProtocols[] = { L"http", L"https" }; |
1966 return ProbeProtocolHandlers(chrome_exe, | 1967 DefaultState default_state = ProbeProtocolHandlers( |
1967 kChromeProtocols, | 1968 chrome_exe, kChromeProtocols, arraysize(kChromeProtocols)); |
1968 arraysize(kChromeProtocols)); | 1969 UpdateDefaultBrowserBeaconWithState(chrome_exe, distribution, default_state); |
| 1970 return default_state; |
1969 } | 1971 } |
1970 | 1972 |
1971 ShellUtil::DefaultState ShellUtil::GetChromeDefaultProtocolClientState( | 1973 ShellUtil::DefaultState ShellUtil::GetChromeDefaultProtocolClientState( |
1972 const base::string16& protocol) { | 1974 const base::string16& protocol) { |
1973 BrowserDistribution* distribution = BrowserDistribution::GetDistribution(); | 1975 BrowserDistribution* distribution = BrowserDistribution::GetDistribution(); |
1974 if (distribution->GetDefaultBrowserControlPolicy() == | 1976 if (distribution->GetDefaultBrowserControlPolicy() == |
1975 BrowserDistribution::DEFAULT_BROWSER_UNSUPPORTED) { | 1977 BrowserDistribution::DEFAULT_BROWSER_UNSUPPORTED) { |
1976 return NOT_DEFAULT; | 1978 return NOT_DEFAULT; |
1977 } | 1979 } |
1978 | 1980 |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 base::string16 key_path(ShellUtil::kRegClasses); | 2511 base::string16 key_path(ShellUtil::kRegClasses); |
2510 key_path.push_back(base::FilePath::kSeparators[0]); | 2512 key_path.push_back(base::FilePath::kSeparators[0]); |
2511 key_path.append(prog_id); | 2513 key_path.append(prog_id); |
2512 return InstallUtil::DeleteRegistryKey( | 2514 return InstallUtil::DeleteRegistryKey( |
2513 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); | 2515 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); |
2514 | 2516 |
2515 // TODO(mgiuca): Remove the extension association entries. This requires that | 2517 // TODO(mgiuca): Remove the extension association entries. This requires that |
2516 // the extensions associated with a particular prog_id are stored in that | 2518 // the extensions associated with a particular prog_id are stored in that |
2517 // prog_id's key. | 2519 // prog_id's key. |
2518 } | 2520 } |
OLD | NEW |