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. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 NULL | 158 NULL |
159 }, { | 159 }, { |
160 base::DIR_START_MENU, | 160 base::DIR_START_MENU, |
161 NULL | 161 NULL |
162 }, { | 162 }, { |
163 base::DIR_APP_DATA, | 163 base::DIR_APP_DATA, |
164 L"Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\StartMenu" | 164 L"Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\StartMenu" |
165 } | 165 } |
166 }; | 166 }; |
167 | 167 |
168 for (int i = 0; i < arraysize(kLocations); ++i) { | 168 for (size_t i = 0; i < arraysize(kLocations); ++i) { |
169 base::FilePath path; | 169 base::FilePath path; |
170 if (!PathService::Get(kLocations[i].location_id, &path)) { | 170 if (!PathService::Get(kLocations[i].location_id, &path)) { |
171 NOTREACHED(); | 171 NOTREACHED(); |
172 continue; | 172 continue; |
173 } | 173 } |
174 | 174 |
175 if (kLocations[i].sub_dir) | 175 if (kLocations[i].sub_dir) |
176 path = path.Append(kLocations[i].sub_dir); | 176 path = path.Append(kLocations[i].sub_dir); |
177 | 177 |
178 bool check_dual_mode = kLocations[i].location_id == base::DIR_START_MENU || | 178 bool check_dual_mode = kLocations[i].location_id == base::DIR_START_MENU || |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 // in the "How would you like to open this?" prompt. | 685 // in the "How would you like to open this?" prompt. |
686 if (!RegisterBrowser()) | 686 if (!RegisterBrowser()) |
687 return false; | 687 return false; |
688 | 688 |
689 ResetDefaultBrowser(); | 689 ResetDefaultBrowser(); |
690 | 690 |
691 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); | 691 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); |
692 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); | 692 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); |
693 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); | 693 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); |
694 } | 694 } |
OLD | NEW |