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

Side by Side Diff: chrome/browser/ui/webui/nacl_ui.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
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/ui/webui/nacl_ui.h" 5 #include "chrome/browser/ui/webui/nacl_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 base::Bind(&NaClDomHandlerProxy::ValidatePnaclPath, this)); 155 base::Bind(&NaClDomHandlerProxy::ValidatePnaclPath, this));
156 return; 156 return;
157 } 157 }
158 158
159 base::FilePath pnacl_path; 159 base::FilePath pnacl_path;
160 bool got_path = PathService::Get(chrome::DIR_PNACL_COMPONENT, &pnacl_path); 160 bool got_path = PathService::Get(chrome::DIR_PNACL_COMPONENT, &pnacl_path);
161 // The PathService may return an empty string if PNaCl is not yet installed. 161 // The PathService may return an empty string if PNaCl is not yet installed.
162 // However, do not trust that the path returned by the PathService exists. 162 // However, do not trust that the path returned by the PathService exists.
163 // Check for existence here. 163 // Check for existence here.
164 ValidatePnaclPathCallback( 164 ValidatePnaclPathCallback(
165 got_path && !pnacl_path.empty() && file_util::PathExists(pnacl_path)); 165 got_path && !pnacl_path.empty() && base::PathExists(pnacl_path));
166 } 166 }
167 167
168 void NaClDomHandlerProxy::ValidatePnaclPathCallback(bool is_valid) { 168 void NaClDomHandlerProxy::ValidatePnaclPathCallback(bool is_valid) {
169 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 169 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
170 BrowserThread::PostTask( 170 BrowserThread::PostTask(
171 BrowserThread::UI, FROM_HERE, 171 BrowserThread::UI, FROM_HERE,
172 base::Bind(&NaClDomHandlerProxy::ValidatePnaclPathCallback, 172 base::Bind(&NaClDomHandlerProxy::ValidatePnaclPathCallback,
173 this, is_valid)); 173 this, is_valid));
174 return; 174 return;
175 } 175 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { 377 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) {
378 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); 378 content::RecordAction(UserMetricsAction("ViewAboutNaCl"));
379 379
380 web_ui->AddMessageHandler(new NaClDomHandler()); 380 web_ui->AddMessageHandler(new NaClDomHandler());
381 381
382 // Set up the about:nacl source. 382 // Set up the about:nacl source.
383 Profile* profile = Profile::FromWebUI(web_ui); 383 Profile* profile = Profile::FromWebUI(web_ui);
384 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); 384 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource());
385 } 385 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/web_applications/web_app_ui.cc ('k') | chrome/browser/ui/webui/options/advanced_options_utils_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698