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

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

Issue 3836005: Move pe_image and registry from base to base/win and use the namespace. It re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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/importer/ie_importer.cc ('k') | chrome/browser/plugin_service.h » ('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) 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>
11 11
12 #include "app/win_util.h" 12 #include "app/win_util.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/file_util.h" 14 #include "base/file_util.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/registry.h"
18 #include "base/scoped_comptr_win.h" 17 #include "base/scoped_comptr_win.h"
19 #include "base/string_util.h" 18 #include "base/string_util.h"
20 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
20 #include "base/win/registry.h"
21 #include "chrome/installer/util/google_update_settings.h" 21 #include "chrome/installer/util/google_update_settings.h"
22 #include "chrome/installer/util/google_update_constants.h" 22 #include "chrome/installer/util/google_update_constants.h"
23 #include "chrome/installer/util/install_util.h" 23 #include "chrome/installer/util/install_util.h"
24 #include "gfx/native_widget_types.h" 24 #include "gfx/native_widget_types.h"
25 #include "googleurl/src/gurl.h" 25 #include "googleurl/src/gurl.h"
26 26
27 namespace platform_util { 27 namespace platform_util {
28 28
29 void ShowItemInFolder(const FilePath& full_path) { 29 void ShowItemInFolder(const FilePath& full_path) {
30 FilePath dir = full_path.DirName(); 30 FilePath dir = full_path.DirName();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // According to Mozilla in uriloader/exthandler/win/nsOSHelperAppService.cpp: 103 // According to Mozilla in uriloader/exthandler/win/nsOSHelperAppService.cpp:
104 // "Some versions of windows (Win2k before SP3, Win XP before SP1) crash in 104 // "Some versions of windows (Win2k before SP3, Win XP before SP1) crash in
105 // ShellExecute on long URLs (bug 161357 on bugzilla.mozilla.org). IE 5 and 6 105 // ShellExecute on long URLs (bug 161357 on bugzilla.mozilla.org). IE 5 and 6
106 // support URLS of 2083 chars in length, 2K is safe." 106 // support URLS of 2083 chars in length, 2K is safe."
107 const size_t kMaxUrlLength = 2048; 107 const size_t kMaxUrlLength = 2048;
108 if (escaped_url.length() > kMaxUrlLength) { 108 if (escaped_url.length() > kMaxUrlLength) {
109 NOTREACHED(); 109 NOTREACHED();
110 return; 110 return;
111 } 111 }
112 112
113 RegKey key; 113 base::win::RegKey key;
114 std::wstring registry_path = ASCIIToWide(url.scheme()) + 114 std::wstring registry_path = ASCIIToWide(url.scheme()) +
115 L"\\shell\\open\\command"; 115 L"\\shell\\open\\command";
116 key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ); 116 key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ);
117 if (key.Valid()) { 117 if (key.Valid()) {
118 DWORD size = 0; 118 DWORD size = 0;
119 key.ReadValue(NULL, NULL, &size, NULL); 119 key.ReadValue(NULL, NULL, &size, NULL);
120 if (size <= 2) { 120 if (size <= 2) {
121 // ShellExecute crashes the process when the command is empty. 121 // ShellExecute crashes the process when the command is empty.
122 // We check for "2" because it always returns the trailing NULL. 122 // We check for "2" because it always returns the trailing NULL.
123 // TODO(nsylvain): we should also add a dialog to warn on errors. See 123 // TODO(nsylvain): we should also add a dialog to warn on errors. See
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 GoogleUpdateSettings::GetChromeChannel(is_system_install, &channel); 177 GoogleUpdateSettings::GetChromeChannel(is_system_install, &channel);
178 } 178 }
179 return UTF16ToASCII(channel); 179 return UTF16ToASCII(channel);
180 #else 180 #else
181 return std::string(); 181 return std::string();
182 #endif 182 #endif
183 } 183 }
184 184
185 } // namespace platform_util 185 } // namespace platform_util
OLDNEW
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/plugin_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698