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

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

Issue 10908088: Cleanup: Constify some ProfileKeyedBaseFactory methods and all overrides. Remove ProfileKeyedBaseFa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, remove a few more lines of code Created 8 years, 3 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/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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 NOTREACHED(); 385 NOTREACHED();
386 return; 386 return;
387 } 387 }
388 if (type == chrome::NOTIFICATION_PREF_CHANGED) { 388 if (type == chrome::NOTIFICATION_PREF_CHANGED) {
389 std::string* pref_name = content::Details<std::string>(details).ptr(); 389 std::string* pref_name = content::Details<std::string>(details).ptr();
390 // If the policy just got disabled we have to unmount every device currently 390 // If the policy just got disabled we have to unmount every device currently
391 // mounted. The opposite is fine - we can let the user re-plug her device to 391 // mounted. The opposite is fine - we can let the user re-plug her device to
392 // make it available. 392 // make it available.
393 if (*pref_name == prefs::kExternalStorageDisabled && 393 if (*pref_name == prefs::kExternalStorageDisabled &&
394 profile_->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled)) { 394 profile_->GetPrefs()->GetBoolean(prefs::kExternalStorageDisabled)) {
395 DiskMountManager *manager = DiskMountManager::GetInstance(); 395 DiskMountManager* manager = DiskMountManager::GetInstance();
396 DiskMountManager::MountPointMap mounts(manager->mount_points()); 396 DiskMountManager::MountPointMap mounts(manager->mount_points());
397 for (DiskMountManager::MountPointMap::const_iterator it = mounts.begin(); 397 for (DiskMountManager::MountPointMap::const_iterator it = mounts.begin();
398 it != mounts.end(); ++it) { 398 it != mounts.end(); ++it) {
399 LOG(INFO) << "Unmounting " << it->second.mount_path 399 LOG(INFO) << "Unmounting " << it->second.mount_path
400 << " because of policy."; 400 << " because of policy.";
401 manager->UnmountPath(it->second.mount_path); 401 manager->UnmountPath(it->second.mount_path);
402 } 402 }
403 return; 403 return;
404 } else if (*pref_name == prefs::kDisableGDataOverCellular || 404 } else if (*pref_name == prefs::kDisableGDataOverCellular ||
405 *pref_name == prefs::kDisableGDataHostedFiles || 405 *pref_name == prefs::kDisableGDataHostedFiles ||
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 854
855 FileBrowserEventRouterFactory::~FileBrowserEventRouterFactory() { 855 FileBrowserEventRouterFactory::~FileBrowserEventRouterFactory() {
856 } 856 }
857 857
858 scoped_refptr<RefcountedProfileKeyedService> 858 scoped_refptr<RefcountedProfileKeyedService>
859 FileBrowserEventRouterFactory::BuildServiceInstanceFor(Profile* profile) const { 859 FileBrowserEventRouterFactory::BuildServiceInstanceFor(Profile* profile) const {
860 return scoped_refptr<RefcountedProfileKeyedService>( 860 return scoped_refptr<RefcountedProfileKeyedService>(
861 new FileBrowserEventRouter(profile)); 861 new FileBrowserEventRouter(profile));
862 } 862 }
863 863
864 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() { 864 bool FileBrowserEventRouterFactory::ServiceHasOwnInstanceInIncognito() const {
865 // Explicitly and always allow this router in guest login mode. see 865 // Explicitly and always allow this router in guest login mode. see
866 // chrome/browser/profiles/profile_keyed_base_factory.h comment 866 // chrome/browser/profiles/profile_keyed_base_factory.h comment
867 // for the details. 867 // for the details.
868 return true; 868 return true;
869 } 869 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698