Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: chrome/installer/gcapi/gcapi.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // NOTE: This code is a legacy utility API for partners to check whether 5 // NOTE: This code is a legacy utility API for partners to check whether
6 // Chrome can be installed and launched. Recent updates are being made 6 // Chrome can be installed and launched. Recent updates are being made
7 // to add new functionality. These updates use code from Chromium, the old 7 // to add new functionality. These updates use code from Chromium, the old
8 // coded against the win32 api directly. If you have an itch to shave a 8 // coded against the win32 api directly. If you have an itch to shave a
9 // yak, feel free to re-write the old code too. 9 // yak, feel free to re-write the old code too.
10 10
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 bool success; 354 bool success;
355 std::set<HWND> shunted_hwnds; 355 std::set<HWND> shunted_hwnds;
356 }; 356 };
357 357
358 BOOL CALLBACK ChromeWindowEnumProc(HWND hwnd, LPARAM lparam) { 358 BOOL CALLBACK ChromeWindowEnumProc(HWND hwnd, LPARAM lparam) {
359 wchar_t window_class[MAX_PATH] = {}; 359 wchar_t window_class[MAX_PATH] = {};
360 SetWindowPosParams* params = reinterpret_cast<SetWindowPosParams*>(lparam); 360 SetWindowPosParams* params = reinterpret_cast<SetWindowPosParams*>(lparam);
361 361
362 if (!params->shunted_hwnds.count(hwnd) && 362 if (!params->shunted_hwnds.count(hwnd) &&
363 ::GetClassName(hwnd, window_class, arraysize(window_class)) && 363 ::GetClassName(hwnd, window_class, arraysize(window_class)) &&
364 base::StartsWith(window_class, kChromeWindowClassPrefix, false) && 364 base::StartsWith(window_class, kChromeWindowClassPrefix,
365 base::CompareCase::INSENSITIVE_ASCII) &&
365 ::SetWindowPos(hwnd, params->window_insert_after, params->x, params->y, 366 ::SetWindowPos(hwnd, params->window_insert_after, params->x, params->y,
366 params->width, params->height, params->flags)) { 367 params->width, params->height, params->flags)) {
367 params->shunted_hwnds.insert(hwnd); 368 params->shunted_hwnds.insert(hwnd);
368 params->success = true; 369 params->success = true;
369 } 370 }
370 371
371 // Return TRUE to ensure we hit all possible top-level Chrome windows as per 372 // Return TRUE to ensure we hit all possible top-level Chrome windows as per
372 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633498.aspx 373 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633498.aspx
373 return TRUE; 374 return TRUE;
374 } 375 }
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 key.WriteValue(kRelaunchAllowedAfterValue, 785 key.WriteValue(kRelaunchAllowedAfterValue,
785 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS || 786 FormatDateOffsetByMonths(6)) != ERROR_SUCCESS ||
786 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) { 787 !SetRelaunchExperimentLabels(relaunch_brandcode, shell_mode)) {
787 if (error_code) 788 if (error_code)
788 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED; 789 *error_code = RELAUNCH_ERROR_RELAUNCH_FAILED;
789 return FALSE; 790 return FALSE;
790 } 791 }
791 792
792 return TRUE; 793 return TRUE;
793 } 794 }
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | chrome/installer/setup/setup_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698