| OLD | NEW |
| 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/extensions/file_browser_event_router.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 error_code == chromeos::MOUNT_ERROR_NONE, | 350 error_code == chromeos::MOUNT_ERROR_NONE, |
| 351 error_code == chromeos::MOUNT_ERROR_UNSUPPORTED_FILESYSTEM); | 351 error_code == chromeos::MOUNT_ERROR_UNSUPPORTED_FILESYSTEM); |
| 352 } else if (mount_info.mount_type == chromeos::MOUNT_TYPE_ARCHIVE) { | 352 } else if (mount_info.mount_type == chromeos::MOUNT_TYPE_ARCHIVE) { |
| 353 // Clear the "mounted" state for archive files in gdata cache | 353 // Clear the "mounted" state for archive files in gdata cache |
| 354 // when mounting failed or unmounting succeeded. | 354 // when mounting failed or unmounting succeeded. |
| 355 if ((event_type == DiskMountManager::MOUNTING) != | 355 if ((event_type == DiskMountManager::MOUNTING) != |
| 356 (error_code == chromeos::MOUNT_ERROR_NONE)) { | 356 (error_code == chromeos::MOUNT_ERROR_NONE)) { |
| 357 FilePath source_path(mount_info.source_path); | 357 FilePath source_path(mount_info.source_path); |
| 358 gdata::GDataSystemService* system_service = | 358 gdata::GDataSystemService* system_service = |
| 359 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 359 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
| 360 gdata::GDataCache* cache = | 360 gdata::DriveCache* cache = |
| 361 system_service ? system_service->cache() : NULL; | 361 system_service ? system_service->cache() : NULL; |
| 362 if (cache) { | 362 if (cache) { |
| 363 cache->SetMountedStateOnUIThread( | 363 cache->SetMountedStateOnUIThread( |
| 364 source_path, false, gdata::ChangeCacheStateCallback()); | 364 source_path, false, gdata::ChangeCacheStateCallback()); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 void FileBrowserEventRouter::OnNetworkManagerChanged( | 370 void FileBrowserEventRouter::OnNetworkManagerChanged( |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 return scoped_refptr<RefcountedProfileKeyedService>( | 861 return scoped_refptr<RefcountedProfileKeyedService>( |
| 862 new FileBrowserEventRouter(profile)); | 862 new FileBrowserEventRouter(profile)); |
| 863 } | 863 } |
| 864 | 864 |
| 865 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { | 865 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { |
| 866 // Explicitly and always allow this router in guest login mode. see | 866 // Explicitly and always allow this router in guest login mode. see |
| 867 // chrome/browser/profiles/profile_keyed_base_factory.h comment | 867 // chrome/browser/profiles/profile_keyed_base_factory.h comment |
| 868 // for the details. | 868 // for the details. |
| 869 return true; | 869 return true; |
| 870 } | 870 } |
| OLD | NEW |