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

Side by Side Diff: chrome/browser/chromeos/policy/app_pack_updater.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/chromeos/policy/app_pack_updater.h" 5 #include "chrome/browser/chromeos/policy/app_pack_updater.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 LOG(ERROR) << "AppPack downloaded extension " << id << " but got bad " 471 LOG(ERROR) << "AppPack downloaded extension " << id << " but got bad "
472 << "version: " << version; 472 << "version: " << version;
473 base::Delete(path, true /* recursive */); 473 base::Delete(path, true /* recursive */);
474 return; 474 return;
475 } 475 }
476 476
477 std::string basename = id + "-" + version + kCRXFileExtension; 477 std::string basename = id + "-" + version + kCRXFileExtension;
478 base::FilePath cache_dir(kAppPackCacheDir); 478 base::FilePath cache_dir(kAppPackCacheDir);
479 base::FilePath cached_crx_path = cache_dir.Append(basename); 479 base::FilePath cached_crx_path = cache_dir.Append(basename);
480 480
481 if (file_util::PathExists(cached_crx_path)) { 481 if (base::PathExists(cached_crx_path)) {
482 LOG(WARNING) << "AppPack downloaded a crx whose filename will overwrite " 482 LOG(WARNING) << "AppPack downloaded a crx whose filename will overwrite "
483 << "an existing cached crx."; 483 << "an existing cached crx.";
484 base::Delete(cached_crx_path, true /* recursive */); 484 base::Delete(cached_crx_path, true /* recursive */);
485 } 485 }
486 486
487 if (!file_util::DirectoryExists(cache_dir)) { 487 if (!file_util::DirectoryExists(cache_dir)) {
488 LOG(ERROR) << "AppPack cache directory does not exist, creating now: " 488 LOG(ERROR) << "AppPack cache directory does not exist, creating now: "
489 << cache_dir.value(); 489 << cache_dir.value();
490 if (!file_util::CreateDirectory(cache_dir)) { 490 if (!file_util::CreateDirectory(cache_dir)) {
491 LOG(ERROR) << "Failed to create the AppPack cache dir!"; 491 LOG(ERROR) << "Failed to create the AppPack cache dir!";
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 void AppPackUpdater::SetScreenSaverPath(const base::FilePath& path) { 558 void AppPackUpdater::SetScreenSaverPath(const base::FilePath& path) {
559 // Don't invoke the callback if the path isn't changing. 559 // Don't invoke the callback if the path isn't changing.
560 if (path != screen_saver_path_) { 560 if (path != screen_saver_path_) {
561 screen_saver_path_ = path; 561 screen_saver_path_ = path;
562 if (!screen_saver_update_callback_.is_null()) 562 if (!screen_saver_update_callback_.is_null())
563 screen_saver_update_callback_.Run(screen_saver_path_); 563 screen_saver_update_callback_.Run(screen_saver_path_);
564 } 564 }
565 } 565 }
566 566
567 } // namespace policy 567 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/mobile/mobile_activator.cc ('k') | chrome/browser/chromeos/policy/enterprise_install_attributes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698