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

Side by Side Diff: cloud_print/service/win/cloud_print_service_config.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlapp.h> // NOLINT 6 #include <atlapp.h> // NOLINT
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 365
366 if (!setup.is_xps_available()) 366 if (!setup.is_xps_available())
367 return ShowError(IDS_ERROR_NO_XPS); 367 return ShowError(IDS_ERROR_NO_XPS);
368 368
369 base::FilePath file = setup.user_data_dir(); 369 base::FilePath file = setup.user_data_dir();
370 file = file.Append(chrome::kServiceStateFileName); 370 file = file.Append(chrome::kServiceStateFileName);
371 371
372 std::string proxy_id; 372 std::string proxy_id;
373 std::string contents; 373 std::string contents;
374 374
375 if (file_util::ReadFileToString(file, &contents)) { 375 if (base::ReadFileToString(file, &contents)) {
376 ServiceState service_state; 376 ServiceState service_state;
377 if (service_state.FromString(contents)) 377 if (service_state.FromString(contents))
378 proxy_id = service_state.proxy_id(); 378 proxy_id = service_state.proxy_id();
379 } 379 }
380 PostUITask(base::Bind(&SetupDialog::AskToCloseChrome, this)); 380 PostUITask(base::Bind(&SetupDialog::AskToCloseChrome, this));
381 contents = ChromeLauncher::CreateServiceStateFile(proxy_id, setup.printers()); 381 contents = ChromeLauncher::CreateServiceStateFile(proxy_id, setup.printers());
382 382
383 if (contents.empty()) 383 if (contents.empty())
384 return ShowError(IDS_ERROR_FAILED_CREATE_CONFIG); 384 return ShowError(IDS_ERROR_FAILED_CREATE_CONFIG);
385 385
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 scoped_refptr<SetupDialog> dialog(new SetupDialog()); 443 scoped_refptr<SetupDialog> dialog(new SetupDialog());
444 dialog->Create(NULL); 444 dialog->Create(NULL);
445 dialog->ShowWindow(SW_SHOW); 445 dialog->ShowWindow(SW_SHOW);
446 scoped_ptr<SetupDialog::MessageFilter> filter( 446 scoped_ptr<SetupDialog::MessageFilter> filter(
447 new SetupDialog::MessageFilter(dialog)); 447 new SetupDialog::MessageFilter(dialog));
448 loop.SetMessageFilter(filter.Pass()); 448 loop.SetMessageFilter(filter.Pass());
449 449
450 loop.Run(); 450 loop.Run();
451 return 0; 451 return 0;
452 } 452 }
OLDNEW
« no previous file with comments | « cloud_print/service/win/cloud_print_service.cc ('k') | components/autofill/core/browser/data_driven_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698