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

Side by Side Diff: chrome/browser/chromeos/drive/drive_integration_service.cc

Issue 492873002: Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single sto… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos build Created 6 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 | 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/drive/drive_integration_service.h" 5 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/prefs/pref_change_registrar.h" 9 #include "base/prefs/pref_change_registrar.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 } 348 }
349 349
350 bool DriveIntegrationService::IsMounted() const { 350 bool DriveIntegrationService::IsMounted() const {
351 if (mount_point_name_.empty()) 351 if (mount_point_name_.empty())
352 return false; 352 return false;
353 353
354 // Look up the registered path, and just discard it. 354 // Look up the registered path, and just discard it.
355 // GetRegisteredPath() returns true if the path is available. 355 // GetRegisteredPath() returns true if the path is available.
356 base::FilePath unused; 356 base::FilePath unused;
357 fileapi::ExternalMountPoints* const mount_points = 357 storage::ExternalMountPoints* const mount_points =
358 fileapi::ExternalMountPoints::GetSystemInstance(); 358 storage::ExternalMountPoints::GetSystemInstance();
359 DCHECK(mount_points); 359 DCHECK(mount_points);
360 return mount_points->GetRegisteredPath(mount_point_name_, &unused); 360 return mount_points->GetRegisteredPath(mount_point_name_, &unused);
361 } 361 }
362 362
363 void DriveIntegrationService::AddObserver( 363 void DriveIntegrationService::AddObserver(
364 DriveIntegrationServiceObserver* observer) { 364 DriveIntegrationServiceObserver* observer) {
365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
366 observers_.AddObserver(observer); 366 observers_.AddObserver(observer);
367 } 367 }
368 368
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 void DriveIntegrationService::AddDriveMountPoint() { 428 void DriveIntegrationService::AddDriveMountPoint() {
429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 429 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
430 DCHECK_EQ(INITIALIZED, state_); 430 DCHECK_EQ(INITIALIZED, state_);
431 DCHECK(enabled_); 431 DCHECK(enabled_);
432 432
433 const base::FilePath& drive_mount_point = 433 const base::FilePath& drive_mount_point =
434 util::GetDriveMountPointPath(profile_); 434 util::GetDriveMountPointPath(profile_);
435 if (mount_point_name_.empty()) 435 if (mount_point_name_.empty())
436 mount_point_name_ = drive_mount_point.BaseName().AsUTF8Unsafe(); 436 mount_point_name_ = drive_mount_point.BaseName().AsUTF8Unsafe();
437 fileapi::ExternalMountPoints* const mount_points = 437 storage::ExternalMountPoints* const mount_points =
438 fileapi::ExternalMountPoints::GetSystemInstance(); 438 storage::ExternalMountPoints::GetSystemInstance();
439 DCHECK(mount_points); 439 DCHECK(mount_points);
440 440
441 bool success = mount_points->RegisterFileSystem( 441 bool success =
442 mount_point_name_, 442 mount_points->RegisterFileSystem(mount_point_name_,
443 fileapi::kFileSystemTypeDrive, 443 storage::kFileSystemTypeDrive,
444 fileapi::FileSystemMountOption(), 444 storage::FileSystemMountOption(),
445 drive_mount_point); 445 drive_mount_point);
446 446
447 if (success) { 447 if (success) {
448 logger_->Log(logging::LOG_INFO, "Drive mount point is added"); 448 logger_->Log(logging::LOG_INFO, "Drive mount point is added");
449 FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_, 449 FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_,
450 OnFileSystemMounted()); 450 OnFileSystemMounted());
451 } 451 }
452 } 452 }
453 453
454 void DriveIntegrationService::RemoveDriveMountPoint() { 454 void DriveIntegrationService::RemoveDriveMountPoint() {
455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
456 456
457 if (!mount_point_name_.empty()) { 457 if (!mount_point_name_.empty()) {
458 job_list()->CancelAllJobs(); 458 job_list()->CancelAllJobs();
459 459
460 FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_, 460 FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_,
461 OnFileSystemBeingUnmounted()); 461 OnFileSystemBeingUnmounted());
462 462
463 fileapi::ExternalMountPoints* const mount_points = 463 storage::ExternalMountPoints* const mount_points =
464 fileapi::ExternalMountPoints::GetSystemInstance(); 464 storage::ExternalMountPoints::GetSystemInstance();
465 DCHECK(mount_points); 465 DCHECK(mount_points);
466 466
467 mount_points->RevokeFileSystem(mount_point_name_); 467 mount_points->RevokeFileSystem(mount_point_name_);
468 logger_->Log(logging::LOG_INFO, "Drive mount point is removed"); 468 logger_->Log(logging::LOG_INFO, "Drive mount point is removed");
469 } 469 }
470 } 470 }
471 471
472 void DriveIntegrationService::Initialize() { 472 void DriveIntegrationService::Initialize() {
473 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 473 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
474 DCHECK_EQ(NOT_INITIALIZED, state_); 474 DCHECK_EQ(NOT_INITIALIZED, state_);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 profile, preference_watcher, 646 profile, preference_watcher,
647 NULL, std::string(), base::FilePath(), NULL); 647 NULL, std::string(), base::FilePath(), NULL);
648 } else { 648 } else {
649 service = factory_for_test_->Run(profile); 649 service = factory_for_test_->Run(profile);
650 } 650 }
651 651
652 return service; 652 return service;
653 } 653 }
654 654
655 } // namespace drive 655 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chrome_quota_permission_context.cc ('k') | chrome/browser/chromeos/drive/file_system_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698