OLD | NEW |
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/media_galleries/media_file_system_registry.h" | 5 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
16 #include "chrome/browser/extensions/extension_system.h" | |
17 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" | 16 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" |
18 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" | 17 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" |
19 #include "chrome/browser/media_galleries/media_file_system_context.h" | 18 #include "chrome/browser/media_galleries/media_file_system_context.h" |
20 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" | 19 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" |
21 #include "chrome/browser/media_galleries/media_galleries_histograms.h" | 20 #include "chrome/browser/media_galleries/media_galleries_histograms.h" |
22 #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" | 21 #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" |
23 #include "chrome/browser/media_galleries/media_scan_manager.h" | 22 #include "chrome/browser/media_galleries/media_scan_manager.h" |
24 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/storage_monitor/media_storage_util.h" | 24 #include "chrome/browser/storage_monitor/media_storage_util.h" |
26 #include "chrome/browser/storage_monitor/storage_monitor.h" | 25 #include "chrome/browser/storage_monitor/storage_monitor.h" |
27 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
28 #include "chrome/common/extensions/extension_constants.h" | 27 #include "chrome/common/extensions/extension_constants.h" |
29 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
30 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
31 #include "content/public/browser/navigation_details.h" | 30 #include "content/public/browser/navigation_details.h" |
32 #include "content/public/browser/render_process_host.h" | 31 #include "content/public/browser/render_process_host.h" |
33 #include "content/public/browser/render_process_host_observer.h" | 32 #include "content/public/browser/render_process_host_observer.h" |
34 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
35 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
36 #include "content/public/browser/web_contents_observer.h" | 35 #include "content/public/browser/web_contents_observer.h" |
| 36 #include "extensions/browser/extension_system.h" |
37 #include "extensions/common/extension.h" | 37 #include "extensions/common/extension.h" |
38 #include "extensions/common/extension_set.h" | 38 #include "extensions/common/extension_set.h" |
39 #include "webkit/browser/fileapi/isolated_context.h" | 39 #include "webkit/browser/fileapi/isolated_context.h" |
40 #include "webkit/common/fileapi/file_system_types.h" | 40 #include "webkit/common/fileapi/file_system_types.h" |
41 | 41 |
42 using content::BrowserThread; | 42 using content::BrowserThread; |
43 using content::NavigationController; | 43 using content::NavigationController; |
44 using content::RenderProcessHost; | 44 using content::RenderProcessHost; |
45 using content::WebContents; | 45 using content::WebContents; |
46 using fileapi::IsolatedContext; | 46 using fileapi::IsolatedContext; |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 DCHECK_EQ(1U, erase_count); | 730 DCHECK_EQ(1U, erase_count); |
731 if (extension_hosts->second.empty()) { | 731 if (extension_hosts->second.empty()) { |
732 // When a profile has no ExtensionGalleriesHosts left, remove the | 732 // When a profile has no ExtensionGalleriesHosts left, remove the |
733 // matching gallery-change-watcher since it is no longer needed. Leave the | 733 // matching gallery-change-watcher since it is no longer needed. Leave the |
734 // |extension_hosts| entry alone, since it indicates the profile has been | 734 // |extension_hosts| entry alone, since it indicates the profile has been |
735 // previously used. | 735 // previously used. |
736 MediaGalleriesPreferences* preferences = GetPreferences(profile); | 736 MediaGalleriesPreferences* preferences = GetPreferences(profile); |
737 preferences->RemoveGalleryChangeObserver(this); | 737 preferences->RemoveGalleryChangeObserver(this); |
738 } | 738 } |
739 } | 739 } |
OLD | NEW |