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

Side by Side Diff: chrome/browser/gtk/options/advanced_contents_gtk.cc

Issue 174490: Fix cases that initialized StringTokenizer with a temporary. (Closed)
Patch Set: check for null path Created 11 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
« no previous file with comments | « base/string_tokenizer.h ('k') | chrome/browser/shell_integration_linux.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gtk/options/advanced_contents_gtk.h" 5 #include "chrome/browser/gtk/options/advanced_contents_gtk.h"
6 6
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 BrowserList::GetLastActive()-> 404 BrowserList::GetLastActive()->
405 OpenURL(GURL(l10n_util::GetStringUTF8(IDS_LINUX_PROXY_CONFIG_URL)), 405 OpenURL(GURL(l10n_util::GetStringUTF8(IDS_LINUX_PROXY_CONFIG_URL)),
406 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); 406 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK);
407 } 407 }
408 } 408 }
409 409
410 // static 410 // static
411 bool NetworkSection::SearchPATH(ProxyConfigCommand* commands, size_t ncommands, 411 bool NetworkSection::SearchPATH(ProxyConfigCommand* commands, size_t ncommands,
412 size_t* index) { 412 size_t* index) {
413 const char* path = getenv("PATH"); 413 const char* path = getenv("PATH");
414 if (!path)
415 return false;
414 FilePath bin_path; 416 FilePath bin_path;
415 StringTokenizer tk(path, ":"); 417 CStringTokenizer tk(path, path + strlen(path), ":");
416 // Search $PATH looking for the commands in order. 418 // Search $PATH looking for the commands in order.
417 while (tk.GetNext()) { 419 while (tk.GetNext()) {
418 for (size_t i = 0; i < ncommands; i++) { 420 for (size_t i = 0; i < ncommands; i++) {
419 bin_path = FilePath(tk.token()).Append(commands[i].argv[0]); 421 bin_path = FilePath(tk.token()).Append(commands[i].argv[0]);
420 if (file_util::PathExists(bin_path)) { 422 if (file_util::PathExists(bin_path)) {
421 commands[i].binary = bin_path.value(); 423 commands[i].binary = bin_path.value();
422 if (index) 424 if (index)
423 *index = i; 425 *index = i;
424 return true; 426 return true;
425 } 427 }
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT), 1097 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT),
1096 web_content_section_->get_page_widget(), false); 1098 web_content_section_->get_page_widget(), false);
1097 1099
1098 security_section_.reset(new SecuritySection(profile_)); 1100 security_section_.reset(new SecuritySection(profile_));
1099 options_builder.AddOptionGroup( 1101 options_builder.AddOptionGroup(
1100 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY), 1102 l10n_util::GetStringUTF8(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY),
1101 security_section_->get_page_widget(), false); 1103 security_section_->get_page_widget(), false);
1102 1104
1103 page_ = options_builder.get_page_widget(); 1105 page_ = options_builder.get_page_widget();
1104 } 1106 }
OLDNEW
« no previous file with comments | « base/string_tokenizer.h ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698