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

Side by Side Diff: chrome/browser/ui/views/external_protocol_dialog.cc

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/shell_integration_win.cc ('k') | chrome/browser/ui/views/shell_dialogs_win.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/ui/views/external_protocol_dialog.h" 5 #include "chrome/browser/ui/views/external_protocol_dialog.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/message_box_flags.h" 8 #include "app/message_box_flags.h"
9 #include "app/text_elider.h" 9 #include "app/text_elider.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 std::wstring url_spec = ASCIIToWide(url.possibly_invalid_spec()); 169 std::wstring url_spec = ASCIIToWide(url.possibly_invalid_spec());
170 std::wstring cmd_key_path = 170 std::wstring cmd_key_path =
171 ASCIIToWide(url.scheme() + "\\shell\\open\\command"); 171 ASCIIToWide(url.scheme() + "\\shell\\open\\command");
172 base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ); 172 base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ);
173 size_t split_offset = url_spec.find(L':'); 173 size_t split_offset = url_spec.find(L':');
174 if (split_offset == std::wstring::npos) 174 if (split_offset == std::wstring::npos)
175 return std::wstring(); 175 return std::wstring();
176 std::wstring parameters = url_spec.substr(split_offset + 1, 176 std::wstring parameters = url_spec.substr(split_offset + 1,
177 url_spec.length() - 1); 177 url_spec.length() - 1);
178 std::wstring application_to_launch; 178 std::wstring application_to_launch;
179 if (cmd_key.ReadValue(NULL, &application_to_launch)) { 179 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) {
180 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters); 180 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters);
181 return application_to_launch; 181 return application_to_launch;
182 } else { 182 } else {
183 return std::wstring(); 183 return std::wstring();
184 } 184 }
185 } 185 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_win.cc ('k') | chrome/browser/ui/views/shell_dialogs_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698