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

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years 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 // See the corresponding header file for description of the functions in this 5 // See the corresponding header file for description of the functions in this
6 // file. 6 // file.
7 7
8 #include "chrome/installer/util/install_util.h" 8 #include "chrome/installer/util/install_util.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 kStageRegisteringChrome, 81 kStageRegisteringChrome,
82 kStageRemovingOldVersions, 82 kStageRemovingOldVersions,
83 kStageFinishing, 83 kStageFinishing,
84 kStageConfiguringAutoLaunch, 84 kStageConfiguringAutoLaunch,
85 kStageCreatingVisualManifest, 85 kStageCreatingVisualManifest,
86 nullptr, // Deprecated with InstallerStage(18) in util_constants.h. 86 nullptr, // Deprecated with InstallerStage(18) in util_constants.h.
87 kStageUninstallingBinaries, 87 kStageUninstallingBinaries,
88 kStageUninstallingChromeFrame, 88 kStageUninstallingChromeFrame,
89 }; 89 };
90 90
91 COMPILE_ASSERT(installer::NUM_STAGES == arraysize(kStages), 91 static_assert(installer::NUM_STAGES == arraysize(kStages),
92 kStages_disagrees_with_Stage_comma_they_must_match_bang); 92 "kStages disagrees with Stage; they must match!");
93 93
94 // Creates a zero-sized non-decorated foreground window that doesn't appear 94 // Creates a zero-sized non-decorated foreground window that doesn't appear
95 // in the taskbar. This is used as a parent window for calls to ShellExecuteEx 95 // in the taskbar. This is used as a parent window for calls to ShellExecuteEx
96 // in order for the UAC dialog to appear in the foreground and for focus 96 // in order for the UAC dialog to appear in the foreground and for focus
97 // to be returned to this process once the UAC task is dismissed. Returns 97 // to be returned to this process once the UAC task is dismissed. Returns
98 // NULL on failure, a handle to the UAC window on success. 98 // NULL on failure, a handle to the UAC window on success.
99 HWND CreateUACForegroundWindow() { 99 HWND CreateUACForegroundWindow() {
100 HWND foreground_window = ::CreateWindowEx(WS_EX_TOOLWINDOW, 100 HWND foreground_window = ::CreateWindowEx(WS_EX_TOOLWINDOW,
101 L"STATIC", 101 L"STATIC",
102 NULL, 102 NULL,
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 // Open the program and see if it references the expected file. 682 // Open the program and see if it references the expected file.
683 base::File file; 683 base::File file;
684 BY_HANDLE_FILE_INFORMATION info = {}; 684 BY_HANDLE_FILE_INFORMATION info = {};
685 685
686 return (OpenForInfo(path, &file) && 686 return (OpenForInfo(path, &file) &&
687 GetInfo(file, &info) && 687 GetInfo(file, &info) &&
688 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && 688 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber &&
689 info.nFileIndexHigh == file_info_.nFileIndexHigh && 689 info.nFileIndexHigh == file_info_.nFileIndexHigh &&
690 info.nFileIndexLow == file_info_.nFileIndexLow); 690 info.nFileIndexLow == file_info_.nFileIndexLow);
691 } 691 }
OLDNEW
« no previous file with comments | « chrome/installer/util/google_update_settings_unittest.cc ('k') | chrome/installer/util/installation_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698