OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
6 | 6 |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // MSVC complains if we don't include != 0. | 151 // MSVC complains if we don't include != 0. |
152 return ::IsWindowVisible(view) != 0; | 152 return ::IsWindowVisible(view) != 0; |
153 } | 153 } |
154 | 154 |
155 void SimpleErrorBox(gfx::NativeWindow parent, | 155 void SimpleErrorBox(gfx::NativeWindow parent, |
156 const string16& title, | 156 const string16& title, |
157 const string16& message) { | 157 const string16& message) { |
158 win_util::MessageBox(parent, message, title, MB_OK | MB_SETFOREGROUND); | 158 win_util::MessageBox(parent, message, title, MB_OK | MB_SETFOREGROUND); |
159 } | 159 } |
160 | 160 |
| 161 bool SimpleYesNoBox(gfx::NativeWindow parent, |
| 162 const string16& title, |
| 163 const string16& message) { |
| 164 return win_util::MessageBox(parent, message.c_str(), title.c_str(), |
| 165 MB_YESNO | MB_ICONWARNING | MB_SETFOREGROUND) == IDYES; |
| 166 } |
| 167 |
161 string16 GetVersionStringModifier() { | 168 string16 GetVersionStringModifier() { |
162 #if defined(GOOGLE_CHROME_BUILD) | 169 #if defined(GOOGLE_CHROME_BUILD) |
163 FilePath module; | 170 FilePath module; |
164 string16 channel; | 171 string16 channel; |
165 if (PathService::Get(base::FILE_MODULE, &module)) { | 172 if (PathService::Get(base::FILE_MODULE, &module)) { |
166 bool is_system_install = | 173 bool is_system_install = |
167 !InstallUtil::IsPerUserInstall(module.value().c_str()); | 174 !InstallUtil::IsPerUserInstall(module.value().c_str()); |
168 | 175 |
169 GoogleUpdateSettings::GetChromeChannel(is_system_install, &channel); | 176 GoogleUpdateSettings::GetChromeChannel(is_system_install, &channel); |
170 } | 177 } |
171 return channel; | 178 return channel; |
172 #else | 179 #else |
173 return string16(); | 180 return string16(); |
174 #endif | 181 #endif |
175 } | 182 } |
176 | 183 |
177 } // namespace platform_util | 184 } // namespace platform_util |
OLD | NEW |