#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/view_type_utils.h"
// Listen for when an extension is unloaded from the same profile, as it may
// be the same extension that this points to.
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ registrar_.Add(this,
+ extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::Source<BrowserContext>(browser_context_));
// Set up web contents observers and pref observers.
since_created_.Elapsed());
}
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
+ extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
ProcessCreationQueue::GetInstance()->Remove(this);
void ExtensionHost::LoadInitialURL() {
host_contents_->GetController().LoadURL(
- initial_url_, content::Referrer(), content::PAGE_TRANSITION_LINK,
+ initial_url_, content::Referrer(), ui::PAGE_TRANSITION_LINK,
std::string());
}
void ExtensionHost::Close() {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
+ case extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
// The extension object will be deleted after this notification has been
// sent. NULL it out so that dirty pointer issues don't arise in cases
// when multiple ExtensionHost objects pointing to the same Extension are
// and they aren't all going to use ExtensionHost. This should be in someplace
// more central, like EPM maybe.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
+ extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
// Send the notification last, because it might result in this being
// deleted.
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
+ extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
->runtime_data()
->SetBackgroundPageReady(extension_, true);
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
+ extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
content::Source<const Extension>(extension_),
content::NotificationService::NoDetails());
}
}
void ExtensionHost::OnEventAck() {
- EventRouter* router = ExtensionSystem::Get(browser_context_)->event_router();
+ EventRouter* router = EventRouter::Get(browser_context_);
if (router)
router->OnEventAck(browser_context_, extension_id());
}
void ExtensionHost::RenderViewReady() {
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
+ extensions::NOTIFICATION_EXTENSION_HOST_CREATED,
content::Source<BrowserContext>(browser_context_),
content::Details<ExtensionHost>(this));
}
web_contents, request, callback, extension());
}
+bool ExtensionHost::CheckMediaAccessPermission(
+ content::WebContents* web_contents,
+ const GURL& security_origin,
+ content::MediaStreamType type) {
+ return delegate_->CheckMediaAccessPermission(
+ web_contents, security_origin, type, extension());
+}
+
+bool ExtensionHost::IsNeverVisible(content::WebContents* web_contents) {
+ ViewType view_type = extensions::GetViewType(web_contents);
+ return view_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE;
+}
+
} // namespace extensions