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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/service.cc

Issue 238633009: cleanup: Use EventRouter instead of ExtensionSystem::Get->event_router() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error for chromeos build. Created 6 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_system_provider/service.h" 5 #include "chrome/browser/chromeos/file_system_provider/service.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h" 9 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h"
10 #include "chrome/browser/chromeos/file_system_provider/observer.h" 10 #include "chrome/browser/chromeos/file_system_provider/observer.h"
11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" 11 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h"
12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" 12 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" 13 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
14 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" 14 #include "chrome/browser/chromeos/file_system_provider/service_factory.h"
15 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
16 #include "extensions/browser/extension_system.h" 16 #include "extensions/browser/event_router.h"
17 #include "webkit/browser/fileapi/external_mount_points.h" 17 #include "webkit/browser/fileapi/external_mount_points.h"
18 18
19 namespace chromeos { 19 namespace chromeos {
20 namespace file_system_provider { 20 namespace file_system_provider {
21 namespace { 21 namespace {
22 22
23 // Maximum number of file systems to be mounted in the same time, per profile. 23 // Maximum number of file systems to be mounted in the same time, per profile.
24 const size_t kMaxFileSystems = 16; 24 const size_t kMaxFileSystems = 16;
25 25
26 // Default factory for provided file systems. The |event_router| must not be 26 // Default factory for provided file systems. The |event_router| must not be
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Store the file system descriptor. Use the mount point name as the file 106 // Store the file system descriptor. Use the mount point name as the file
107 // system provider file system id. 107 // system provider file system id.
108 // Examples: 108 // Examples:
109 // file_system_id = 41 109 // file_system_id = 41
110 // mount_point_name = file_system_id = b33f1337-41-5aa5 110 // mount_point_name = file_system_id = b33f1337-41-5aa5
111 // mount_point_path = /provided/b33f1337-41-5aa5 111 // mount_point_path = /provided/b33f1337-41-5aa5
112 ProvidedFileSystemInfo file_system_info( 112 ProvidedFileSystemInfo file_system_info(
113 extension_id, file_system_id, file_system_name, mount_point_path); 113 extension_id, file_system_id, file_system_name, mount_point_path);
114 114
115 // The event router may be NULL for unit tests. 115 // The event router may be NULL for unit tests.
116 extensions::EventRouter* event_router = 116 extensions::EventRouter* router = extensions::EventRouter::Get(profile_);
117 extensions::ExtensionSystem::Get(profile_)->event_router();
118 117
119 ProvidedFileSystemInterface* file_system = 118 ProvidedFileSystemInterface* file_system =
120 file_system_factory_.Run(event_router, file_system_info); 119 file_system_factory_.Run(router, file_system_info);
121 DCHECK(file_system); 120 DCHECK(file_system);
122 file_system_map_[file_system_id] = file_system; 121 file_system_map_[file_system_id] = file_system;
123 122
124 FOR_EACH_OBSERVER( 123 FOR_EACH_OBSERVER(
125 Observer, 124 Observer,
126 observers_, 125 observers_,
127 OnProvidedFileSystemMount(file_system_info, base::File::FILE_OK)); 126 OnProvidedFileSystemMount(file_system_info, base::File::FILE_OK));
128 127
129 next_id_++; 128 next_id_++;
130 return file_system_id; 129 return file_system_id;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // invoked, and observers notified, so there is no need to call them now. 227 // invoked, and observers notified, so there is no need to call them now.
229 if (error != base::File::FILE_OK) { 228 if (error != base::File::FILE_OK) {
230 FOR_EACH_OBSERVER(Observer, 229 FOR_EACH_OBSERVER(Observer,
231 observers_, 230 observers_,
232 OnProvidedFileSystemUnmount(file_system_info, error)); 231 OnProvidedFileSystemUnmount(file_system_info, error));
233 } 232 }
234 } 233 }
235 234
236 } // namespace file_system_provider 235 } // namespace file_system_provider
237 } // namespace chromeos 236 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_browser_handlers.cc ('k') | chrome/browser/chromeos/login/wallpaper_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698