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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ssl/ssl_blocking_page.h" 5 #include "chrome/browser/ssl/ssl_blocking_page.h"
6 6
7 #include "base/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // opens the overview. This will have to be good enough. 250 // opens the overview. This will have to be good enough.
251 { "/usr/bin/gnome-control-center", "datetime" }, 251 { "/usr/bin/gnome-control-center", "datetime" },
252 { "/usr/local/bin/gnome-control-center", "datetime" }, 252 { "/usr/local/bin/gnome-control-center", "datetime" },
253 { "/opt/bin/gnome-control-center", "datetime" }, 253 { "/opt/bin/gnome-control-center", "datetime" },
254 // KDE 254 // KDE
255 { "/usr/bin/kcmshell4", "clock" }, 255 { "/usr/bin/kcmshell4", "clock" },
256 { "/usr/local/bin/kcmshell4", "clock" }, 256 { "/usr/local/bin/kcmshell4", "clock" },
257 { "/opt/bin/kcmshell4", "clock" }, 257 { "/opt/bin/kcmshell4", "clock" },
258 }; 258 };
259 259
260 CommandLine command(base::FilePath("")); 260 base::CommandLine command(base::FilePath(""));
261 for (size_t i = 0; i < arraysize(kClockCommands); ++i) { 261 for (size_t i = 0; i < arraysize(kClockCommands); ++i) {
262 base::FilePath pathname(kClockCommands[i].pathname); 262 base::FilePath pathname(kClockCommands[i].pathname);
263 if (base::PathExists(pathname)) { 263 if (base::PathExists(pathname)) {
264 command.SetProgram(pathname); 264 command.SetProgram(pathname);
265 command.AppendArg(kClockCommands[i].argument); 265 command.AppendArg(kClockCommands[i].argument);
266 break; 266 break;
267 } 267 }
268 } 268 }
269 if (command.GetProgram().empty()) { 269 if (command.GetProgram().empty()) {
270 // Alas, there is nothing we can do. 270 // Alas, there is nothing we can do.
271 return; 271 return;
272 } 272 }
273 273
274 base::LaunchOptions options; 274 base::LaunchOptions options;
275 options.wait = false; 275 options.wait = false;
276 options.allow_new_privs = true; 276 options.allow_new_privs = true;
277 base::LaunchProcess(command, options); 277 base::LaunchProcess(command, options);
278 278
279 #elif defined(OS_MACOSX) 279 #elif defined(OS_MACOSX)
280 CommandLine command(base::FilePath("/usr/bin/open")); 280 base::CommandLine command(base::FilePath("/usr/bin/open"));
281 command.AppendArg("/System/Library/PreferencePanes/DateAndTime.prefPane"); 281 command.AppendArg("/System/Library/PreferencePanes/DateAndTime.prefPane");
282 282
283 base::LaunchOptions options; 283 base::LaunchOptions options;
284 options.wait = false; 284 options.wait = false;
285 base::LaunchProcess(command, options); 285 base::LaunchProcess(command, options);
286 286
287 #elif defined(OS_WIN) 287 #elif defined(OS_WIN)
288 base::FilePath path; 288 base::FilePath path;
289 PathService::Get(base::DIR_SYSTEM, &path); 289 PathService::Get(base::DIR_SYSTEM, &path);
290 static const base::char16 kControlPanelExe[] = L"control.exe"; 290 static const base::char16 kControlPanelExe[] = L"control.exe";
291 path = path.Append(base::string16(kControlPanelExe)); 291 path = path.Append(base::string16(kControlPanelExe));
292 CommandLine command(path); 292 base::CommandLine command(path);
293 command.AppendArg(std::string("/name")); 293 command.AppendArg(std::string("/name"));
294 command.AppendArg(std::string("Microsoft.DateAndTime")); 294 command.AppendArg(std::string("Microsoft.DateAndTime"));
295 295
296 base::LaunchOptions options; 296 base::LaunchOptions options;
297 options.wait = false; 297 options.wait = false;
298 base::LaunchProcess(command, options); 298 base::LaunchProcess(command, options);
299 299
300 #else 300 #else
301 NOTREACHED(); 301 NOTREACHED();
302 302
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 for (; i < 5; i++) { 719 for (; i < 5; i++) {
720 strings->SetString(keys[i], std::string()); 720 strings->SetString(keys[i], std::string());
721 } 721 }
722 } 722 }
723 723
724 void SSLBlockingPage::OnGotHistoryCount(bool success, 724 void SSLBlockingPage::OnGotHistoryCount(bool success,
725 int num_visits, 725 int num_visits,
726 base::Time first_visit) { 726 base::Time first_visit) {
727 num_visits_ = num_visits; 727 num_visits_ = num_visits;
728 } 728 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698