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 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1835 | 1835 |
1836 // static | 1836 // static |
1837 bool ShellUtil::CanMakeChromeDefaultUnattended() { | 1837 bool ShellUtil::CanMakeChromeDefaultUnattended() { |
1838 return base::win::GetVersion() < base::win::VERSION_WIN8; | 1838 return base::win::GetVersion() < base::win::VERSION_WIN8; |
1839 } | 1839 } |
1840 | 1840 |
1841 // static | 1841 // static |
1842 ShellUtil::InteractiveSetDefaultMode ShellUtil::GetInteractiveSetDefaultMode() { | 1842 ShellUtil::InteractiveSetDefaultMode ShellUtil::GetInteractiveSetDefaultMode() { |
1843 DCHECK(!CanMakeChromeDefaultUnattended()); | 1843 DCHECK(!CanMakeChromeDefaultUnattended()); |
1844 | 1844 |
1845 if (base::win::GetVersion() == base::win::VERSION_WIN8) | 1845 if (base::win::GetVersion() >= base::win::VERSION_WIN10) |
1846 return InteractiveSetDefaultMode::INTENT_PICKER; | 1846 return InteractiveSetDefaultMode::SYSTEM_SETTINGS; |
1847 | 1847 |
1848 return InteractiveSetDefaultMode::SYSTEM_SETTINGS; | 1848 return InteractiveSetDefaultMode::INTENT_PICKER; |
1849 } | 1849 } |
1850 | 1850 |
1851 bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist, | 1851 bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist, |
1852 int shell_change, | 1852 int shell_change, |
1853 const base::FilePath& chrome_exe, | 1853 const base::FilePath& chrome_exe, |
1854 bool elevate_if_not_admin) { | 1854 bool elevate_if_not_admin) { |
1855 DCHECK(!(shell_change & SYSTEM_LEVEL) || IsUserAnAdmin()); | 1855 DCHECK(!(shell_change & SYSTEM_LEVEL) || IsUserAnAdmin()); |
1856 | 1856 |
1857 BrowserDistribution* distribution = BrowserDistribution::GetDistribution(); | 1857 BrowserDistribution* distribution = BrowserDistribution::GetDistribution(); |
1858 if (distribution->GetDefaultBrowserControlPolicy() != | 1858 if (distribution->GetDefaultBrowserControlPolicy() != |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 itr != entries.end(); ++itr) | 2387 itr != entries.end(); ++itr) |
2388 (*itr)->AddToWorkItemList(root, items.get()); | 2388 (*itr)->AddToWorkItemList(root, items.get()); |
2389 | 2389 |
2390 // Apply all the registry changes and if there is a problem, rollback | 2390 // Apply all the registry changes and if there is a problem, rollback |
2391 if (!items->Do()) { | 2391 if (!items->Do()) { |
2392 items->Rollback(); | 2392 items->Rollback(); |
2393 return false; | 2393 return false; |
2394 } | 2394 } |
2395 return true; | 2395 return true; |
2396 } | 2396 } |
OLD | NEW |