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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 disk->system_path_prefix(), disk->drive_label(), disk->is_parent(), | 311 disk->system_path_prefix(), disk->drive_label(), disk->is_parent(), |
312 error_code == chromeos::MOUNT_ERROR_NONE, | 312 error_code == chromeos::MOUNT_ERROR_NONE, |
313 error_code == chromeos::MOUNT_ERROR_UNSUPORTED_FILESYSTEM); | 313 error_code == chromeos::MOUNT_ERROR_UNSUPORTED_FILESYSTEM); |
314 } else if (mount_info.mount_type == chromeos::MOUNT_TYPE_ARCHIVE) { | 314 } else if (mount_info.mount_type == chromeos::MOUNT_TYPE_ARCHIVE) { |
315 // Clear the "mounted" state for archive files in gdata cache | 315 // Clear the "mounted" state for archive files in gdata cache |
316 // when mounting failed or unmounting succeeded. | 316 // when mounting failed or unmounting succeeded. |
317 if ((event_type == DiskMountManager::MOUNTING) != | 317 if ((event_type == DiskMountManager::MOUNTING) != |
318 (error_code == chromeos::MOUNT_ERROR_NONE)) { | 318 (error_code == chromeos::MOUNT_ERROR_NONE)) { |
319 FilePath source_path(mount_info.source_path); | 319 FilePath source_path(mount_info.source_path); |
320 gdata::GDataFileSystem* file_system = GetRemoteFileSystem(); | 320 gdata::GDataFileSystem* file_system = GetRemoteFileSystem(); |
321 if (file_system && file_system->IsUnderGDataCacheDirectory(source_path)) | 321 gdata::GDataSystemService* system_service = |
| 322 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
| 323 if (file_system && system_service && |
| 324 system_service->cache()->IsUnderGDataCacheDirectory(source_path)) { |
322 file_system->SetMountedState(source_path, false, | 325 file_system->SetMountedState(source_path, false, |
323 gdata::SetMountedStateCallback()); | 326 gdata::SetMountedStateCallback()); |
| 327 } |
324 } | 328 } |
325 } | 329 } |
326 } | 330 } |
327 | 331 |
328 void FileBrowserEventRouter::OnNetworkManagerChanged( | 332 void FileBrowserEventRouter::OnNetworkManagerChanged( |
329 chromeos::NetworkLibrary* network_library) { | 333 chromeos::NetworkLibrary* network_library) { |
330 if (!profile_ || !profile_->GetExtensionEventRouter()) { | 334 if (!profile_ || !profile_->GetExtensionEventRouter()) { |
331 NOTREACHED(); | 335 NOTREACHED(); |
332 return; | 336 return; |
333 } | 337 } |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 return scoped_refptr<RefcountedProfileKeyedService>( | 781 return scoped_refptr<RefcountedProfileKeyedService>( |
778 new FileBrowserEventRouter(profile)); | 782 new FileBrowserEventRouter(profile)); |
779 } | 783 } |
780 | 784 |
781 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { | 785 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { |
782 // Explicitly and always allow this router in guest login mode. see | 786 // Explicitly and always allow this router in guest login mode. see |
783 // chrome/browser/profiles/profile_keyed_base_factory.h comment | 787 // chrome/browser/profiles/profile_keyed_base_factory.h comment |
784 // for the details. | 788 // for the details. |
785 return true; | 789 return true; |
786 } | 790 } |
OLD | NEW |