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

Side by Side Diff: chrome/browser/chromeos/file_manager/volume_manager.cc

Issue 314033002: Files.app: Flip the flag and enable MTP support by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/file_manager/volume_manager.h" 5 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 // Subscribe to Privet volume lister. 388 // Subscribe to Privet volume lister.
389 if (CommandLine::ForCurrentProcess()->HasSwitch( 389 if (CommandLine::ForCurrentProcess()->HasSwitch(
390 switches::kEnablePrivetStorage)) { 390 switches::kEnablePrivetStorage)) {
391 privet_volume_lister_.reset(new local_discovery::PrivetVolumeLister( 391 privet_volume_lister_.reset(new local_discovery::PrivetVolumeLister(
392 base::Bind(&VolumeManager::OnPrivetVolumesAvailable, 392 base::Bind(&VolumeManager::OnPrivetVolumesAvailable,
393 weak_ptr_factory_.GetWeakPtr()))); 393 weak_ptr_factory_.GetWeakPtr())));
394 privet_volume_lister_->Start(); 394 privet_volume_lister_->Start();
395 } 395 }
396 396
397 // Subscribe to storage monitor for MTP notifications. 397 // Subscribe to storage monitor for MTP notifications.
398 if (CommandLine::ForCurrentProcess()->HasSwitch( 398 const bool disable_mtp =
399 chromeos::switches::kEnableFileManagerMTP) && 399 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
400 storage_monitor::StorageMonitor::GetInstance()) { 400 chromeos::switches::kEnableFileManagerMTP) == "false";
401 if (!disable_mtp && storage_monitor::StorageMonitor::GetInstance()) {
401 storage_monitor::StorageMonitor::GetInstance()->EnsureInitialized( 402 storage_monitor::StorageMonitor::GetInstance()->EnsureInitialized(
402 base::Bind(&VolumeManager::OnStorageMonitorInitialized, 403 base::Bind(&VolumeManager::OnStorageMonitorInitialized,
403 weak_ptr_factory_.GetWeakPtr())); 404 weak_ptr_factory_.GetWeakPtr()));
404 } 405 }
405 } 406 }
406 407
407 void VolumeManager::Shutdown() { 408 void VolumeManager::Shutdown() {
408 weak_ptr_factory_.InvalidateWeakPtrs(); 409 weak_ptr_factory_.InvalidateWeakPtrs();
409 410
410 pref_change_registrar_.RemoveAll(); 411 pref_change_registrar_.RemoveAll();
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 return; 838 return;
838 if (error_code == chromeos::MOUNT_ERROR_NONE) 839 if (error_code == chromeos::MOUNT_ERROR_NONE)
839 mounted_volumes_.erase(volume_info.volume_id); 840 mounted_volumes_.erase(volume_info.volume_id);
840 841
841 FOR_EACH_OBSERVER(VolumeManagerObserver, 842 FOR_EACH_OBSERVER(VolumeManagerObserver,
842 observers_, 843 observers_,
843 OnVolumeUnmounted(error_code, volume_info)); 844 OnVolumeUnmounted(error_code, volume_info));
844 } 845 }
845 846
846 } // namespace file_manager 847 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698