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

Side by Side Diff: chrome/browser/platform_util_win.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/performance_monitor/database.cc ('k') | chrome/browser/plugins/plugin_finder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (message) 111 if (message)
112 LocalFree(message); 112 LocalFree(message);
113 } 113 }
114 } 114 }
115 } 115 }
116 116
117 // Old ShellExecute crashes the process when the command for a given scheme 117 // Old ShellExecute crashes the process when the command for a given scheme
118 // is empty. This function tells if it is. 118 // is empty. This function tells if it is.
119 bool ValidateShellCommandForScheme(const std::string& scheme) { 119 bool ValidateShellCommandForScheme(const std::string& scheme) {
120 base::win::RegKey key; 120 base::win::RegKey key;
121 std::wstring registry_path = ASCIIToWide(scheme) + 121 std::wstring registry_path = base::ASCIIToWide(scheme) +
122 L"\\shell\\open\\command"; 122 L"\\shell\\open\\command";
123 key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ); 123 key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ);
124 if (!key.Valid()) 124 if (!key.Valid())
125 return false; 125 return false;
126 DWORD size = 0; 126 DWORD size = 0;
127 key.ReadValue(NULL, NULL, &size, NULL); 127 key.ReadValue(NULL, NULL, &size, NULL);
128 if (size <= 2) 128 if (size <= 2)
129 return false; 129 return false;
130 return true; 130 return true;
131 } 131 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ::SetForegroundWindow(window); 197 ::SetForegroundWindow(window);
198 } 198 }
199 199
200 bool IsVisible(gfx::NativeView view) { 200 bool IsVisible(gfx::NativeView view) {
201 // MSVC complains if we don't include != 0. 201 // MSVC complains if we don't include != 0.
202 return ::IsWindowVisible(view) != 0; 202 return ::IsWindowVisible(view) != 0;
203 } 203 }
204 #endif 204 #endif
205 205
206 } // namespace platform_util 206 } // namespace platform_util
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/database.cc ('k') | chrome/browser/plugins/plugin_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698