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

Side by Side Diff: chrome/browser/win/settings_app_monitor.cc

Issue 2161193003: Use __func__ instead of __FUNCTION__. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/win/settings_app_monitor.h" 5 #include "chrome/browser/win/settings_app_monitor.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 #include <oleauto.h> 9 #include <oleauto.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 PROPERTYID property_id) { 162 PROPERTYID property_id) {
163 HRESULT result = S_OK; 163 HRESULT result = S_OK;
164 base::win::ScopedVariant var; 164 base::win::ScopedVariant var;
165 165
166 result = element->GetCachedPropertyValueEx(property_id, TRUE, var.Receive()); 166 result = element->GetCachedPropertyValueEx(property_id, TRUE, var.Receive());
167 if (FAILED(result)) 167 if (FAILED(result))
168 return base::string16(); 168 return base::string16();
169 169
170 if (V_VT(var.ptr()) != VT_BSTR) { 170 if (V_VT(var.ptr()) != VT_BSTR) {
171 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN) 171 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN)
172 << __FUNCTION__ << " property is not a BSTR: " << V_VT(var.ptr()); 172 << __func__ << " property is not a BSTR: " << V_VT(var.ptr());
173 return base::string16(); 173 return base::string16();
174 } 174 }
175 175
176 return base::string16(V_BSTR(var.ptr())); 176 return base::string16(V_BSTR(var.ptr()));
177 } 177 }
178 178
179 enum class ElementType { 179 enum class ElementType {
180 // The "Web browser" element in the "Default apps" pane. 180 // The "Web browser" element in the "Default apps" pane.
181 DEFAULT_BROWSER, 181 DEFAULT_BROWSER,
182 // The element representing a browser in the "Choose an app" popup. 182 // The element representing a browser in the "Choose an app" popup.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 #if ENABLE_DLOG 217 #if ENABLE_DLOG
218 base::win::ScopedVariant var; 218 base::win::ScopedVariant var;
219 219
220 if (FAILED(element->GetCachedPropertyValueEx(property_id, TRUE, 220 if (FAILED(element->GetCachedPropertyValueEx(property_id, TRUE,
221 var.Receive()))) { 221 var.Receive()))) {
222 return false; 222 return false;
223 } 223 }
224 224
225 if (V_VT(var.ptr()) != VT_BOOL) { 225 if (V_VT(var.ptr()) != VT_BOOL) {
226 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN) 226 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN)
227 << __FUNCTION__ << " property is not a BOOL: " << V_VT(var.ptr()); 227 << __func__ << " property is not a BOOL: " << V_VT(var.ptr());
228 return false; 228 return false;
229 } 229 }
230 230
231 return V_BOOL(var.ptr()) != 0; 231 return V_BOOL(var.ptr()) != 0;
232 #else // ENABLE_DLOG 232 #else // ENABLE_DLOG
233 return false; 233 return false;
234 #endif // !ENABLE_DLOG 234 #endif // !ENABLE_DLOG
235 } 235 }
236 236
237 int32_t GetCachedInt32Value(IUIAutomationElement* element, 237 int32_t GetCachedInt32Value(IUIAutomationElement* element,
238 PROPERTYID property_id) { 238 PROPERTYID property_id) {
239 #if ENABLE_DLOG 239 #if ENABLE_DLOG
240 base::win::ScopedVariant var; 240 base::win::ScopedVariant var;
241 241
242 if (FAILED(element->GetCachedPropertyValueEx(property_id, TRUE, 242 if (FAILED(element->GetCachedPropertyValueEx(property_id, TRUE,
243 var.Receive()))) { 243 var.Receive()))) {
244 return false; 244 return false;
245 } 245 }
246 246
247 if (V_VT(var.ptr()) != VT_I4) { 247 if (V_VT(var.ptr()) != VT_I4) {
248 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN) 248 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN)
249 << __FUNCTION__ << " property is not an I4: " << V_VT(var.ptr()); 249 << __func__ << " property is not an I4: " << V_VT(var.ptr());
250 return false; 250 return false;
251 } 251 }
252 252
253 return V_I4(var.ptr()); 253 return V_I4(var.ptr());
254 #else // ENABLE_DLOG 254 #else // ENABLE_DLOG
255 return 0; 255 return 0;
256 #endif // !ENABLE_DLOG 256 #endif // !ENABLE_DLOG
257 } 257 }
258 258
259 std::vector<int32_t> GetCachedInt32ArrayValue(IUIAutomationElement* element, 259 std::vector<int32_t> GetCachedInt32ArrayValue(IUIAutomationElement* element,
260 PROPERTYID property_id) { 260 PROPERTYID property_id) {
261 std::vector<int32_t> values; 261 std::vector<int32_t> values;
262 #if ENABLE_DLOG 262 #if ENABLE_DLOG
263 base::win::ScopedVariant var; 263 base::win::ScopedVariant var;
264 264
265 if (FAILED(element->GetCachedPropertyValueEx(property_id, TRUE, 265 if (FAILED(element->GetCachedPropertyValueEx(property_id, TRUE,
266 var.Receive()))) { 266 var.Receive()))) {
267 return values; 267 return values;
268 } 268 }
269 269
270 if (V_VT(var.ptr()) != (VT_I4 | VT_ARRAY)) { 270 if (V_VT(var.ptr()) != (VT_I4 | VT_ARRAY)) {
271 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN) 271 LOG_IF(ERROR, V_VT(var.ptr()) != VT_UNKNOWN)
272 << __FUNCTION__ << " property is not an I4 array: " << V_VT(var.ptr()); 272 << __func__ << " property is not an I4 array: " << V_VT(var.ptr());
273 return values; 273 return values;
274 } 274 }
275 275
276 SAFEARRAY* array = V_ARRAY(var.ptr()); 276 SAFEARRAY* array = V_ARRAY(var.ptr());
277 if (SafeArrayGetDim(array) != 1) 277 if (SafeArrayGetDim(array) != 1)
278 return values; 278 return values;
279 long lower_bound = 0; 279 long lower_bound = 0;
280 long upper_bound = 0; 280 long upper_bound = 0;
281 SafeArrayGetLBound(array, 1, &lower_bound); 281 SafeArrayGetLBound(array, 1, &lower_bound);
282 SafeArrayGetUBound(array, 1, &upper_bound); 282 SafeArrayGetUBound(array, 1, &upper_bound);
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 delegate_->OnChooserInvoked(); 737 delegate_->OnChooserInvoked();
738 } 738 }
739 739
740 void SettingsAppMonitor::OnBrowserChosen(const base::string16& browser_name) { 740 void SettingsAppMonitor::OnBrowserChosen(const base::string16& browser_name) {
741 DCHECK(thread_checker_.CalledOnValidThread()); 741 DCHECK(thread_checker_.CalledOnValidThread());
742 delegate_->OnBrowserChosen(browser_name); 742 delegate_->OnBrowserChosen(browser_name);
743 } 743 }
744 744
745 } // namespace win 745 } // namespace win
746 } // namespace shell_integration 746 } // namespace shell_integration
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc ('k') | chrome/install_static/install_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698