Index: chrome/browser/chromeos/extensions/file_browser_event_router.cc |
diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc |
index d4fb18406e33c8117b482be5f6e2735f984c8615..121cd7cb920ccb912d00aebfad5ef13eed0a47be 100644 |
--- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc |
+++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc |
@@ -55,36 +55,32 @@ DictionaryValue* DiskToDictionaryValue( |
return result; |
} |
-ExtensionFileBrowserEventRouter::ExtensionFileBrowserEventRouter() |
+ExtensionFileBrowserEventRouter::ExtensionFileBrowserEventRouter( |
+ Profile* profile) |
: delegate_(new ExtensionFileBrowserEventRouter::FileWatcherDelegate()), |
- profile_(NULL) { |
+ profile_(profile) { |
} |
ExtensionFileBrowserEventRouter::~ExtensionFileBrowserEventRouter() { |
DCHECK(file_watchers_.empty()); |
STLDeleteValues(&file_watchers_); |
- if (!profile_) |
+ if (!profile_) { |
+ NOTREACHED(); |
return; |
+ } |
if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) |
return; |
chromeos::MountLibrary* lib = |
chromeos::CrosLibrary::Get()->GetMountLibrary(); |
lib->RemoveObserver(this); |
- profile_ = NULL; |
-} |
- |
-// static |
-ExtensionFileBrowserEventRouter* |
- ExtensionFileBrowserEventRouter::GetInstance() { |
- return Singleton<ExtensionFileBrowserEventRouter>::get(); |
} |
-void ExtensionFileBrowserEventRouter::ObserveFileSystemEvents( |
- Profile* profile) { |
- if (!profile) |
+void ExtensionFileBrowserEventRouter::Init() { |
+ if (!profile_) { |
+ NOTREACHED(); |
return; |
- profile_ = profile; |
+ } |
if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) |
return; |
if (chromeos::UserManager::Get()->user_is_logged_in()) { |
@@ -133,17 +129,6 @@ void ExtensionFileBrowserEventRouter::RemoveFileWatch( |
} |
} |
-void ExtensionFileBrowserEventRouter::StopObservingFileSystemEvents() { |
- if (!profile_) |
- return; |
- if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) |
- return; |
- chromeos::MountLibrary* lib = |
- chromeos::CrosLibrary::Get()->GetMountLibrary(); |
- lib->RemoveObserver(this); |
- profile_ = NULL; |
-} |
- |
void ExtensionFileBrowserEventRouter::DiskChanged( |
chromeos::MountLibraryEventType event, |
const chromeos::MountLibrary::Disk* disk) { |