| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/installer/gcapi/gcapi.h" | 5 #include "chrome/installer/gcapi/gcapi.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <sddl.h> | 10 #include <sddl.h> |
| 11 #include <stdlib.h> | 11 #include <stdlib.h> |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 | 308 |
| 309 // Then only check whether we can re-offer, if everything else is OK. | 309 // Then only check whether we can re-offer, if everything else is OK. |
| 310 if (local_reasons == 0 && !CanReOfferChrome(set_flag)) | 310 if (local_reasons == 0 && !CanReOfferChrome(set_flag)) |
| 311 local_reasons |= GCCC_ERROR_ALREADYOFFERED; | 311 local_reasons |= GCCC_ERROR_ALREADYOFFERED; |
| 312 | 312 |
| 313 // Done. Copy/return results. | 313 // Done. Copy/return results. |
| 314 if (reasons != NULL) | 314 if (reasons != NULL) |
| 315 *reasons = local_reasons; | 315 *reasons = local_reasons; |
| 316 | 316 |
| 317 return (*reasons == 0); | 317 return (local_reasons == 0); |
| 318 } | 318 } |
| 319 | 319 |
| 320 #pragma comment(linker, "/EXPORT:LaunchGoogleChrome=_LaunchGoogleChrome@0,PRIVAT
E") | 320 #pragma comment(linker, "/EXPORT:LaunchGoogleChrome=_LaunchGoogleChrome@0,PRIVAT
E") |
| 321 DLLEXPORT BOOL __stdcall LaunchGoogleChrome() { | 321 DLLEXPORT BOOL __stdcall LaunchGoogleChrome() { |
| 322 wchar_t launch_cmd[MAX_PATH]; | 322 wchar_t launch_cmd[MAX_PATH]; |
| 323 size_t size = _countof(launch_cmd); | 323 size_t size = _countof(launch_cmd); |
| 324 if (!ReadValueFromRegistry(HKEY_LOCAL_MACHINE, kChromeRegClientStateKey, | 324 if (!ReadValueFromRegistry(HKEY_LOCAL_MACHINE, kChromeRegClientStateKey, |
| 325 kChromeRegLastLaunchCmd, launch_cmd, &size)) { | 325 kChromeRegLastLaunchCmd, launch_cmd, &size)) { |
| 326 size = _countof(launch_cmd); | 326 size = _countof(launch_cmd); |
| 327 if (!ReadValueFromRegistry(HKEY_LOCAL_MACHINE, kChromeRegClientStateKey, | 327 if (!ReadValueFromRegistry(HKEY_LOCAL_MACHINE, kChromeRegClientStateKey, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // This loop iterates through all of the top-level Windows named | 440 // This loop iterates through all of the top-level Windows named |
| 441 // Chrome_WidgetWin_0, and looks for the first one with any children. | 441 // Chrome_WidgetWin_0, and looks for the first one with any children. |
| 442 while (handle && !FindWindowEx(handle, NULL, L"Chrome_WidgetWin_0", NULL)) { | 442 while (handle && !FindWindowEx(handle, NULL, L"Chrome_WidgetWin_0", NULL)) { |
| 443 // Get the next top-level Chrome window. | 443 // Get the next top-level Chrome window. |
| 444 handle = FindWindowEx(NULL, handle, L"Chrome_WidgetWin_0", NULL); | 444 handle = FindWindowEx(NULL, handle, L"Chrome_WidgetWin_0", NULL); |
| 445 } | 445 } |
| 446 | 446 |
| 447 return (handle && | 447 return (handle && |
| 448 SetWindowPos(handle, 0, x, y, width, height, SWP_NOZORDER)); | 448 SetWindowPos(handle, 0, x, y, width, height, SWP_NOZORDER)); |
| 449 } | 449 } |
| OLD | NEW |