Commit a63d646e authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision fc6ad471 (#342568)

parent a08686e6
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '12bfc3360892ec53cd00fc239a47e5298beb063b',
'chromium_checkout': 'fc6ad471b796214148d81208b38601de0c86bc9f',
}
......@@ -947,12 +947,14 @@
'<(DEPTH)/components/components.gyp:pdf_renderer',
'<(DEPTH)/components/components.gyp:plugins_renderer',
'<(DEPTH)/components/components.gyp:pref_registry',
'<(DEPTH)/components/components.gyp:printing_browser',
'<(DEPTH)/components/components.gyp:printing_common',
'<(DEPTH)/components/components.gyp:printing_renderer',
'<(DEPTH)/components/components.gyp:proxy_config',
'<(DEPTH)/components/components.gyp:update_client',
'<(DEPTH)/components/components.gyp:user_prefs',
'<(DEPTH)/components/components.gyp:web_cache_renderer',
'<(DEPTH)/components/url_formatter/url_formatter.gyp:url_formatter',
'<(DEPTH)/content/content.gyp:content_app_both',
'<(DEPTH)/content/content.gyp:content_browser',
'<(DEPTH)/content/content.gyp:content_common',
......@@ -1236,6 +1238,8 @@
'libcef/renderer/dom_document_impl.h',
'libcef/renderer/dom_node_impl.cc',
'libcef/renderer/dom_node_impl.h',
'libcef/renderer/extensions/extensions_dispatcher_delegate.cc',
'libcef/renderer/extensions/extensions_dispatcher_delegate.h',
'libcef/renderer/extensions/extensions_renderer_client.cc',
'libcef/renderer/extensions/extensions_renderer_client.h',
'libcef/renderer/extensions/print_web_view_helper_delegate.cc',
......@@ -1417,12 +1421,12 @@
'libcef/common/util_mac.h',
'libcef/common/util_mac.mm',
# Include sources for spell checking support.
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc',
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter_mac.h',
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_platform_mac.h',
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter_platform.h',
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac.cc',
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_platform.h',
'<(DEPTH)/chrome/browser/spellchecker/spellcheck_platform_mac.mm',
'<(DEPTH)/chrome/renderer/spellchecker/cocoa_spelling_engine_mac.cc',
'<(DEPTH)/chrome/renderer/spellchecker/cocoa_spelling_engine_mac.h',
'<(DEPTH)/chrome/renderer/spellchecker/platform_spelling_engine.cc',
'<(DEPTH)/chrome/renderer/spellchecker/platform_spelling_engine.h',
# Include sources for pepper flash support.
'<(DEPTH)/chrome/browser/renderer_host/pepper/monitor_finder_mac.h',
'<(DEPTH)/chrome/browser/renderer_host/pepper/monitor_finder_mac.mm',
......
......@@ -66,7 +66,7 @@
#endif
#if defined(OS_MACOSX)
#include "chrome/browser/spellchecker/spellcheck_platform_mac.h"
#include "chrome/browser/spellchecker/spellcheck_platform.h"
#endif
#if defined(USE_AURA)
......@@ -1080,7 +1080,7 @@ void CefBrowserHostImpl::AddWordToDictionary(const CefString& word) {
spellcheck->GetCustomDictionary()->AddWord(word);
}
#if defined(OS_MACOSX)
spellcheck_mac::AddWord(word);
spellcheck_platform::AddWord(word);
#endif
}
......@@ -2796,6 +2796,11 @@ void CefBrowserHostImpl::FrameDeleted(
focused_frame_id_ = CefFrameHostImpl::kInvalidFrameId;
}
void CefBrowserHostImpl::TitleWasSet(content::NavigationEntry* entry,
bool explicit_set) {
OnTitleChange(entry->GetTitle());
}
void CefBrowserHostImpl::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
if (client_.get()) {
......@@ -2960,28 +2965,12 @@ void CefBrowserHostImpl::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK(type == content::NOTIFICATION_LOAD_STOP ||
type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE ||
type == content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED);
if (type == content::NOTIFICATION_LOAD_STOP ||
type == content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED) {
base::string16 title;
if (type == content::NOTIFICATION_LOAD_STOP) {
content::NavigationController* controller =
content::Source<content::NavigationController>(source).ptr();
title = controller->GetWebContents()->GetTitle();
} else {
content::WebContents* web_contents =
content::Source<content::WebContents>(source).ptr();
title = web_contents->GetTitle();
}
type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE);
if (client_.get()) {
CefRefPtr<CefDisplayHandler> handler = client_->GetDisplayHandler();
if (handler.get())
handler->OnTitleChange(this, title);
}
if (type == content::NOTIFICATION_LOAD_STOP) {
content::NavigationController* controller =
content::Source<content::NavigationController>(source).ptr();
OnTitleChange(controller->GetWebContents()->GetTitle());
} else if (type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE) {
focus_on_editable_field_ = *content::Details<bool>(details).ptr();
}
......@@ -3040,8 +3029,6 @@ CefBrowserHostImpl::CefBrowserHostImpl(
g_manager.Get().AddImpl(this);
registrar_.reset(new content::NotificationRegistrar);
registrar_->Add(this, content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED,
content::Source<content::WebContents>(web_contents));
// When navigating through the history, the restored NavigationEntry's title
// will be used. If the entry ends up having the same title after we return
......@@ -3230,6 +3217,14 @@ void CefBrowserHostImpl::OnFullscreenModeChange(bool fullscreen) {
}
}
void CefBrowserHostImpl::OnTitleChange(const base::string16& title) {
if (client_.get()) {
CefRefPtr<CefDisplayHandler> handler = client_->GetDisplayHandler();
if (handler.get())
handler->OnTitleChange(this, title);
}
}
void CefBrowserHostImpl::RunFileChooserOnUIThread(
const FileChooserParams& params,
const RunFileChooserCallback& callback) {
......
......@@ -471,6 +471,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool was_ignored_by_handler) override;
void FrameDeleted(
content::RenderFrameHost* render_frame_host) override;
void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override;
void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) override;
void DidUpdateFaviconURL(
......@@ -596,6 +597,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
const GURL& url,
int http_status_code);
void OnFullscreenModeChange(bool fullscreen);
void OnTitleChange(const base::string16& title);
// Continuation from RunFileChooser.
void RunFileChooserOnUIThread(const FileChooserParams& params,
......
......@@ -278,3 +278,9 @@ memory::OomPriorityManager* ChromeBrowserProcessStub::GetOomPriorityManager() {
NOTIMPLEMENTED();
return NULL;
}
ShellIntegration::DefaultWebClientState
ChromeBrowserProcessStub::CachedDefaultWebClientState() {
NOTIMPLEMENTED();
return ShellIntegration::UNKNOWN_DEFAULT;
}
......@@ -97,6 +97,8 @@ class ChromeBrowserProcessStub : public BrowserProcess {
network_time::NetworkTimeTracker* network_time_tracker() override;
gcm::GCMDriver* gcm_driver() override;
memory::OomPriorityManager* GetOomPriorityManager() override;
ShellIntegration::DefaultWebClientState
CachedDefaultWebClientState() override;
private:
std::string locale_;
......
......@@ -209,7 +209,8 @@ const ResourcesMap* CreateResourcesMap() {
const int resource_id = kWebuiResources[i].value;
AddResource(resource_name, resource_id, result);
for (const char* (&alias)[2]: kPathAliases) {
if (base::StartsWithASCII(resource_name, alias[0], true)) {
if (base::StartsWith(resource_name, alias[0],
base::CompareCase::SENSITIVE)) {
AddResource(alias[1] + resource_name.substr(strlen(alias[0])),
resource_id, result);
}
......
......@@ -63,7 +63,7 @@
#include "url/gurl.h"
#if defined(OS_MACOSX)
#include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h"
#include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
......@@ -568,7 +568,7 @@ void CefContentBrowserClient::RenderProcessWillLaunch(
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
host->AddFilter(new SpellCheckMessageFilter(id));
#if defined(OS_MACOSX)
host->AddFilter(new SpellCheckMessageFilterMac(id));
host->AddFilter(new SpellCheckMessageFilterPlatform(id));
#endif
}
......@@ -668,6 +668,16 @@ bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
return CefContentClient::Get()->HasCustomScheme(scheme);
}
bool CefContentBrowserClient::IsNPAPIEnabled() {
#if defined(OS_WIN) || defined(OS_MACOSX)
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
return command_line->HasSwitch(switches::kEnableNPAPI);
#else
return false;
#endif
}
void CefContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line, int child_process_id) {
const base::CommandLine* browser_cmd =
......
......@@ -89,6 +89,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::URLRequestInterceptorScopedVector request_interceptors)
override;
bool IsHandledURL(const GURL& url) override;
bool IsNPAPIEnabled() override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
content::QuotaPermissionContext*
......
......@@ -225,7 +225,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
params->GetSize() == 1 && params->GetString(0, &browser_message)) {
agent_host_->DispatchProtocolMessage(browser_message);
} else if (method == "loadCompleted") {
web_contents()->GetMainFrame()->ExecuteJavaScript(
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"));
} else if (method == "loadNetworkResource" && params->GetSize() == 3) {
// TODO(pfeldman): handle some of the embedder messages in content.
......@@ -292,7 +292,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
if (message.length() < kMaxMessageChunkSize) {
base::string16 javascript = base::UTF8ToUTF16(
"DevToolsAPI.dispatchMessage(" + message + ");");
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript);
return;
}
......@@ -303,7 +303,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
base::StringValue(message.substr(pos, kMaxMessageChunkSize)), &param);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript);
}
}
......@@ -351,7 +351,7 @@ void CefDevToolsFrontend::CallClientFunction(
}
}
javascript.append(");");
web_contents()->GetMainFrame()->ExecuteJavaScript(
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
base::UTF8ToUTF16(javascript));
}
......
......@@ -78,7 +78,7 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler(
// If the mime handler uses MimeHandlerViewGuest, the MimeHandlerViewGuest
// will take ownership of the stream. Otherwise, store the stream handle in
// |streams_| and fire an event notifying the extension.
if (!handler->handler_url().empty()) {
if (handler->HasPlugin()) {
GURL handler_url(Extension::GetBaseURLFromExtensionId(extension_id).spec() +
handler->handler_url());
scoped_ptr<StreamContainer> stream_container(new StreamContainer(
......@@ -108,9 +108,10 @@ void StreamsPrivateAPI::ExecuteMimeTypeHandler(
CreateResponseHeadersDictionary(stream->response_headers.get(),
&info.response_headers.additional_properties);
scoped_ptr<Event> event(new Event(
events::UNKNOWN, streams_private::OnExecuteMimeTypeHandler::kEventName,
streams_private::OnExecuteMimeTypeHandler::Create(info)));
scoped_ptr<Event> event(
new Event(events::STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER,
streams_private::OnExecuteMimeTypeHandler::kEventName,
streams_private::OnExecuteMimeTypeHandler::Create(info)));
EventRouter::Get(browser_context_)
->DispatchEventToExtension(extension_id, event.Pass());
......
......@@ -23,13 +23,16 @@ EventRouterForwarder::~EventRouterForwarder() {
}
void EventRouterForwarder::BroadcastEventToRenderers(
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url) {
HandleEvent(std::string(), event_name, event_args.Pass(), 0, true, event_url);
HandleEvent(std::string(), histogram_value, event_name, event_args.Pass(), 0,
true, event_url);
}
void EventRouterForwarder::DispatchEventToRenderers(
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
......@@ -37,24 +40,23 @@ void EventRouterForwarder::DispatchEventToRenderers(
const GURL& event_url) {
if (!profile)
return;
HandleEvent(std::string(),
event_name,
event_args.Pass(),
profile,
use_profile_to_restrict_events,
event_url);
HandleEvent(std::string(), histogram_value, event_name, event_args.Pass(),
profile, use_profile_to_restrict_events, event_url);
}
void EventRouterForwarder::BroadcastEventToExtension(
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url) {
HandleEvent(extension_id, event_name, event_args.Pass(), 0, true, event_url);
HandleEvent(extension_id, histogram_value, event_name, event_args.Pass(), 0,
true, event_url);
}
void EventRouterForwarder::DispatchEventToExtension(
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
......@@ -62,11 +64,12 @@ void EventRouterForwarder::DispatchEventToExtension(
const GURL& event_url) {
if (!profile)
return;
HandleEvent(extension_id, event_name, event_args.Pass(), profile,
use_profile_to_restrict_events, event_url);
HandleEvent(extension_id, histogram_value, event_name, event_args.Pass(),
profile, use_profile_to_restrict_events, event_url);
}
void EventRouterForwarder::HandleEvent(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile_ptr,
......@@ -75,8 +78,8 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&EventRouterForwarder::HandleEvent, this,
extension_id, event_name, base::Passed(&event_args),
base::Bind(&EventRouterForwarder::HandleEvent, this, extension_id,
histogram_value, event_name, base::Passed(&event_args),
profile_ptr, use_profile_to_restrict_events, event_url));
return;
}
......@@ -88,7 +91,8 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
return;
}
if (profile) {
CallEventRouter(profile, extension_id, event_name, event_args.Pass(),
CallEventRouter(profile, extension_id, histogram_value, event_name,
event_args.Pass(),
use_profile_to_restrict_events ? profile : NULL, event_url);
} else {
std::vector<CefBrowserContextImpl*> profiles(
......@@ -96,9 +100,10 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
for (size_t i = 0; i < profiles.size(); ++i) {
scoped_ptr<base::ListValue> per_profile_event_args(
event_args->DeepCopy());
CallEventRouter(
profiles[i], extension_id, event_name, per_profile_event_args.Pass(),
use_profile_to_restrict_events ? profiles[i] : NULL, event_url);
CallEventRouter(profiles[i], extension_id, histogram_value, event_name,
per_profile_event_args.Pass(),
use_profile_to_restrict_events ? profiles[i] : NULL,
event_url);
}
}
}
......@@ -106,12 +111,13 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
void EventRouterForwarder::CallEventRouter(
content::BrowserContext* profile,
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
content::BrowserContext* restrict_to_profile,
const GURL& event_url) {
scoped_ptr<Event> event(
new Event(events::UNKNOWN, event_name, event_args.Pass()));
new Event(histogram_value, event_name, event_args.Pass()));
event->restrict_to_browser_context = restrict_to_profile;
event->event_url = event_url;
if (extension_id.empty()) {
......
......@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/values.h"
#include "extensions/browser/extension_event_histogram_value.h"
class GURL;
......@@ -37,7 +38,8 @@ class EventRouterForwarder
// DispatchEventToRenderers(event_name, event_args, profile, event_url)
// on all (original) profiles' EventRouters.
// May be called on any thread.
void BroadcastEventToRenderers(const std::string& event_name,
void BroadcastEventToRenderers(events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url);
......@@ -47,6 +49,7 @@ class EventRouterForwarder
// on all (original) profiles' EventRouters.
// May be called on any thread.
void BroadcastEventToExtension(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url);
......@@ -55,7 +58,8 @@ class EventRouterForwarder
// DispatchEventToRenderers(event_name, event_args,
// use_profile_to_restrict_events ? profile : NULL, event_url)
// on |profile|'s EventRouter. May be called on any thread.
void DispatchEventToRenderers(const std::string& event_name,
void DispatchEventToRenderers(events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
bool use_profile_to_restrict_events,
......@@ -66,6 +70,7 @@ class EventRouterForwarder
// use_profile_to_restrict_events ? profile : NULL, event_url)
// on |profile|'s EventRouter. May be called on any thread.
void DispatchEventToExtension(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
......@@ -79,6 +84,7 @@ class EventRouterForwarder
// Helper function for {Broadcast,Dispatch}EventTo{Extension,Renderers}.
// Virtual for testing.
virtual void HandleEvent(const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
......@@ -91,6 +97,7 @@ class EventRouterForwarder
// Virtual for testing.
virtual void CallEventRouter(content::BrowserContext* profile,
const std::string& extension_id,
events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
content::BrowserContext* restrict_to_profile,
......
......@@ -32,6 +32,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/common/constants.h"
......@@ -77,7 +78,8 @@ base::DictionaryValue* ParseManifest(
CefExtensionSystem::CefExtensionSystem(BrowserContext* browser_context)
: browser_context_(browser_context),
registry_(ExtensionRegistry::Get(browser_context)) {
registry_(ExtensionRegistry::Get(browser_context)),
weak_ptr_factory_(this) {
}
CefExtensionSystem::~CefExtensionSystem() {
......@@ -128,6 +130,9 @@ void CefExtensionSystem::Init() {
// kPDFPluginOutOfProcessMimeType which loads the PDF PPAPI plugin.
// 10.Routing of print-related commands are handled by ChromePDFPrintClient
// and CefPrintWebViewHelperDelegate in the renderer process.
// 11.The PDF extension is granted access to chrome://resources via
// CefExtensionsDispatcherDelegate::InitOriginPermissions in the renderer
// process.
if (PdfExtensionEnabled()) {
AddExtension(pdf_extension_util::GetManifest(),
base::FilePath(FILE_PATH_LITERAL("pdf")));
......@@ -166,6 +171,7 @@ void CefExtensionSystem::Shutdown() {
void CefExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
runtime_data_.reset(new RuntimeData(registry_));
quota_service_.reset(new QuotaService);
app_sorting_.reset(new NullAppSorting);
}
ExtensionService* CefExtensionSystem::extension_service() {
......@@ -202,13 +208,18 @@ QuotaService* CefExtensionSystem::quota_service() {
return quota_service_.get();
}
AppSorting* CefExtensionSystem::app_sorting() {
return app_sorting_.get();
}
// Implementation based on
// ExtensionSystemImpl::RegisterExtensionWithRequestContexts.
void CefExtensionSystem::RegisterExtensionWithRequestContexts(
const Extension* extension) {
const Extension* extension,
const base::Closure& callback) {
// TODO(extensions): The |incognito_enabled| value should be set based on
// manifest settings.
BrowserThread::PostTask(
BrowserThread::PostTaskAndReply(
BrowserThread::IO,
FROM_HERE,
base::Bind(&InfoMap::AddExtension,
......@@ -216,7 +227,8 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts(
make_scoped_refptr(extension),
base::Time::Now(),
true, // incognito_enabled
false)); // notifications_disabled
false), // notifications_disabled
callback);
}
// Implementation based on
......@@ -336,7 +348,11 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
// that the request context doesn't yet know about. The profile is responsible
// for ensuring its URLRequestContexts appropriately discover the loaded
// extension.
RegisterExtensionWithRequestContexts(extension);
RegisterExtensionWithRequestContexts(
extension,
base::Bind(&CefExtensionSystem::OnExtensionRegisteredWithRequestContexts,
weak_ptr_factory_.GetWeakPtr(),
make_scoped_refptr(extension)));
// Tell renderers about the new extension, unless it's a theme (renderers
// don't need to know about themes).
......@@ -400,6 +416,13 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) {
content::Details<const Extension>(extension));
}
void CefExtensionSystem::OnExtensionRegisteredWithRequestContexts(
scoped_refptr<const extensions::Extension> extension) {
registry_->AddReady(extension);
if (registry_->enabled_extensions().Contains(extension->id()))
registry_->TriggerOnReady(extension.get());
}
// Implementation based on ExtensionService::NotifyExtensionUnloaded.
void CefExtensionSystem::NotifyExtensionUnloaded(
const Extension* extension,
......
......@@ -9,6 +9,7 @@
#include <vector>
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/one_shot_event.h"
......@@ -60,8 +61,10 @@ class CefExtensionSystem : public ExtensionSystem {
StateStore* rules_store() override;
InfoMap* info_map() override;
QuotaService* quota_service() override;
AppSorting* app_sorting() override;
void RegisterExtensionWithRequestContexts(
const Extension* extension) override;
const Extension* extension,
const base::Closure& callback) override;
void UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const UnloadedExtensionInfo::Reason reason) override;
......@@ -105,6 +108,11 @@ class CefExtensionSystem : public ExtensionSystem {
const Extension* extension,
UnloadedExtensionInfo::Reason reason);
// Completes extension loading after URLRequestContexts have been updated
// on the IO thread.
void OnExtensionRegisteredWithRequestContexts(
scoped_refptr<const extensions::Extension> extension);
content::BrowserContext* browser_context_; // Not owned.
// Data to be accessed on the IO thread. Must outlive process_manager_.
......@@ -112,6 +120,7 @@ class CefExtensionSystem : public ExtensionSystem {
scoped_ptr<RuntimeData> runtime_data_;
scoped_ptr<QuotaService> quota_service_;
scoped_ptr<AppSorting> app_sorting_;
// Signaled when the extension system has completed its startup tasks.
OneShotEvent ready_;
......@@ -119,6 +128,9 @@ class CefExtensionSystem : public ExtensionSystem {
// Sets of enabled/disabled/terminated/blacklisted extensions. Not owned.
ExtensionRegistry* registry_;
// Must be the last member.
base::WeakPtrFactory<CefExtensionSystem> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(CefExtensionSystem);
};
......
......@@ -24,7 +24,6 @@
#include "extensions/browser/extension_function_registry.h"
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/mojo/service_registration.h"
#include "extensions/browser/null_app_sorting.h"
#include "extensions/browser/url_request_util.h"
using content::BrowserContext;
......@@ -154,10 +153,6 @@ bool CefExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) {
void CefExtensionsBrowserClient::PermitExternalProtocolHandler() {
}
scoped_ptr<AppSorting> CefExtensionsBrowserClient::CreateAppSorting() {
return scoped_ptr<AppSorting>(new NullAppSorting);
}
bool CefExtensionsBrowserClient::IsRunningInForcedAppMode() {
return false;
}
......@@ -176,10 +171,10 @@ CefExtensionsBrowserClient::GetExtensionSystemFactory() {
void CefExtensionsBrowserClient::RegisterExtensionFunctions(
ExtensionFunctionRegistry* registry) const {
// Register core extension-system APIs.
core_api::GeneratedFunctionRegistry::RegisterAll(registry);
api::GeneratedFunctionRegistry::RegisterAll(registry);
// CEF-only APIs.