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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_event_router.cc

Issue 10546093: gdata: Move ownership of GDataCache to GDataSystemService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO Created 8 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_browser_private_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_browser_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698