OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/metro_utils/metro_chrome_win.h" | 5 #include "chrome/browser/metro_utils/metro_chrome_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shobjidl.h> | 8 #include <shobjidl.h> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/win/metro.h" | 12 #include "base/win/metro.h" |
13 #include "base/win/scoped_com_initializer.h" | 13 #include "base/win/scoped_com_initializer.h" |
14 #include "base/win/scoped_comptr.h" | 14 #include "base/win/scoped_comptr.h" |
| 15 #include "base/win/windows_version.h" |
15 #include "chrome/installer/util/browser_distribution.h" | 16 #include "chrome/installer/util/browser_distribution.h" |
16 #include "chrome/installer/util/install_util.h" | 17 #include "chrome/installer/util/install_util.h" |
17 #include "chrome/installer/util/shell_util.h" | 18 #include "chrome/installer/util/shell_util.h" |
18 | 19 |
19 namespace chrome { | 20 namespace chrome { |
20 | 21 |
21 bool ActivateMetroChrome() { | 22 bool ActivateMetroChrome() { |
| 23 // TODO(cpu): For Win7 we need to activate differently. |
| 24 if (base::win::GetVersion() < base::win::VERSION_WIN8) |
| 25 return true; |
| 26 |
22 base::FilePath chrome_exe; | 27 base::FilePath chrome_exe; |
23 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { | 28 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
24 NOTREACHED() << "Failed to get chrome exe path"; | 29 NOTREACHED() << "Failed to get chrome exe path"; |
25 return false; | 30 return false; |
26 } | 31 } |
27 | 32 |
28 base::string16 app_id = ShellUtil::GetBrowserModelId( | 33 base::string16 app_id = ShellUtil::GetBrowserModelId( |
29 BrowserDistribution::GetDistribution(), | 34 BrowserDistribution::GetDistribution(), |
30 InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())); | 35 InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())); |
31 if (app_id.empty()) { | 36 if (app_id.empty()) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #else | 70 #else |
66 if (base::win::IsProcessImmersive(::GetCurrentProcess())) | 71 if (base::win::IsProcessImmersive(::GetCurrentProcess())) |
67 return WIN_8_ENVIRONMENT_METRO; | 72 return WIN_8_ENVIRONMENT_METRO; |
68 else | 73 else |
69 return WIN_8_ENVIRONMENT_DESKTOP; | 74 return WIN_8_ENVIRONMENT_DESKTOP; |
70 #endif | 75 #endif |
71 } | 76 } |
72 | 77 |
73 | 78 |
74 } // namespace chrome | 79 } // namespace chrome |
OLD | NEW |