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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 1312653003: Fix for WebView accessible resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments by lfg@. Created 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "content/public/browser/notification_service.h" 65 #include "content/public/browser/notification_service.h"
66 #include "content/public/browser/render_process_host.h" 66 #include "content/public/browser/render_process_host.h"
67 #include "content/public/browser/storage_partition.h" 67 #include "content/public/browser/storage_partition.h"
68 #include "extensions/browser/app_sorting.h" 68 #include "extensions/browser/app_sorting.h"
69 #include "extensions/browser/event_router.h" 69 #include "extensions/browser/event_router.h"
70 #include "extensions/browser/extension_host.h" 70 #include "extensions/browser/extension_host.h"
71 #include "extensions/browser/extension_prefs.h" 71 #include "extensions/browser/extension_prefs.h"
72 #include "extensions/browser/extension_registry.h" 72 #include "extensions/browser/extension_registry.h"
73 #include "extensions/browser/extension_system.h" 73 #include "extensions/browser/extension_system.h"
74 #include "extensions/browser/extensions_browser_client.h" 74 #include "extensions/browser/extensions_browser_client.h"
75 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
75 #include "extensions/browser/install_flag.h" 76 #include "extensions/browser/install_flag.h"
76 #include "extensions/browser/runtime_data.h" 77 #include "extensions/browser/runtime_data.h"
77 #include "extensions/browser/uninstall_reason.h" 78 #include "extensions/browser/uninstall_reason.h"
78 #include "extensions/browser/update_observer.h" 79 #include "extensions/browser/update_observer.h"
79 #include "extensions/browser/updater/extension_cache.h" 80 #include "extensions/browser/updater/extension_cache.h"
80 #include "extensions/browser/updater/extension_downloader.h" 81 #include "extensions/browser/updater/extension_downloader.h"
81 #include "extensions/common/extension_messages.h" 82 #include "extensions/common/extension_messages.h"
82 #include "extensions/common/extension_urls.h" 83 #include "extensions/common/extension_urls.h"
83 #include "extensions/common/feature_switch.h" 84 #include "extensions/common/feature_switch.h"
84 #include "extensions/common/file_util.h" 85 #include "extensions/common/file_util.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 content::RenderProcessHost* host = i.GetCurrentValue(); 1039 content::RenderProcessHost* host = i.GetCurrentValue();
1039 Profile* host_profile = 1040 Profile* host_profile =
1040 Profile::FromBrowserContext(host->GetBrowserContext()); 1041 Profile::FromBrowserContext(host->GetBrowserContext());
1041 if (host_profile->GetOriginalProfile() == 1042 if (host_profile->GetOriginalProfile() ==
1042 profile_->GetOriginalProfile()) { 1043 profile_->GetOriginalProfile()) {
1043 // We don't need to include tab permisisons here, since the extension 1044 // We don't need to include tab permisisons here, since the extension
1044 // was just loaded. 1045 // was just loaded.
1045 std::vector<ExtensionMsg_Loaded_Params> loaded_extensions( 1046 std::vector<ExtensionMsg_Loaded_Params> loaded_extensions(
1046 1, ExtensionMsg_Loaded_Params(extension, 1047 1, ExtensionMsg_Loaded_Params(extension,
1047 false /* no tab permissions */)); 1048 false /* no tab permissions */));
1048 host->Send( 1049 host->Send(new ExtensionMsg_Loaded(
1049 new ExtensionMsg_Loaded(loaded_extensions)); 1050 loaded_extensions, extensions::WebViewGuest::GetPartitionID(host)));
1050 } 1051 }
1051 } 1052 }
1052 } 1053 }
1053 1054
1054 // Tell subsystems that use the EXTENSION_LOADED notification about the new 1055 // Tell subsystems that use the EXTENSION_LOADED notification about the new
1055 // extension. 1056 // extension.
1056 // 1057 //
1057 // NOTE: It is important that this happen after notifying the renderers about 1058 // NOTE: It is important that this happen after notifying the renderers about
1058 // the new extensions so that if we navigate to an extension URL in 1059 // the new extensions so that if we navigate to an extension URL in
1059 // ExtensionRegistryObserver::OnLoaded or 1060 // ExtensionRegistryObserver::OnLoaded or
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2577 } 2578 }
2578 2579
2579 void ExtensionService::OnProfileDestructionStarted() { 2580 void ExtensionService::OnProfileDestructionStarted() {
2580 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2581 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2581 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2582 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2582 it != ids_to_unload.end(); 2583 it != ids_to_unload.end();
2583 ++it) { 2584 ++it) {
2584 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2585 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2585 } 2586 }
2586 } 2587 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698