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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 92743002: Extract UI dependencies from ExtensionHost, part 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase extension_view_host Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/extensions/extension_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 46ba15f887734f3deb2c08222a4cdf23df26564e..fc25744394213235285407ac2b41f6a089202a07 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -25,13 +25,13 @@
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h"
#include "chrome/browser/ui/browser_dialogs.h"
-#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/prefs/prefs_tab_helper.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.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 "content/public/browser/notification_service.h"
@@ -40,7 +40,6 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_view.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_error.h"
#include "extensions/browser/process_manager.h"
@@ -50,10 +49,7 @@
#include "extensions/common/feature_switch.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "ui/base/l10n/l10n_util.h"
-
-#if !defined(OS_ANDROID)
-#include "components/web_modal/web_contents_modal_dialog_manager.h"
-#endif
+#include "ui/base/window_open_disposition.h"
using blink::WebDragOperation;
using blink::WebDragOperationsMask;
@@ -212,25 +208,6 @@ const GURL& ExtensionHost::GetURL() const {
}
void ExtensionHost::LoadInitialURL() {
- if (!IsBackgroundPage() &&
- !ExtensionSystem::GetForBrowserContext(browser_context_)->
- extension_service()->IsBackgroundPageReady(extension_)) {
- // Make sure the background page loads before any others.
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
- content::Source<Extension>(extension_));
- return;
- }
-
-#if !defined(OS_ANDROID)
- // TODO(jamescook): Move this to ExtensionViewHost, which handles popups.
- if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) {
- web_modal::WebContentsModalDialogManager::CreateForWebContents(
- host_contents_.get());
- web_modal::WebContentsModalDialogManager::FromWebContents(
- host_contents_.get())->SetDelegate(this);
- }
-#endif
-
host_contents_->GetController().LoadURL(
initial_url_, content::Referrer(), content::PAGE_TRANSITION_LINK,
std::string());
@@ -248,49 +225,10 @@ void ExtensionHost::Close() {
content::Details<ExtensionHost>(this));
}
-#if !defined(OS_ANDROID)
-web_modal::WebContentsModalDialogHost*
-ExtensionHost::GetWebContentsModalDialogHost() {
- return this;
-}
-
-gfx::NativeView ExtensionHost::GetHostView() const {
- return NULL;
-}
-
-gfx::Point ExtensionHost::GetDialogPosition(const gfx::Size& size) {
- if (!GetVisibleWebContents())
- return gfx::Point();
- gfx::Rect bounds = GetVisibleWebContents()->GetView()->GetViewBounds();
- return gfx::Point(
- std::max(0, (bounds.width() - size.width()) / 2),
- std::max(0, (bounds.height() - size.height()) / 2));
-}
-
-gfx::Size ExtensionHost::GetMaximumDialogSize() {
- if (!GetVisibleWebContents())
- return gfx::Size();
- return GetVisibleWebContents()->GetView()->GetViewBounds().size();
-}
-
-void ExtensionHost::AddObserver(
- web_modal::ModalDialogHostObserver* observer) {
-}
-
-void ExtensionHost::RemoveObserver(
- web_modal::ModalDialogHostObserver* observer) {
-}
-#endif
-
void ExtensionHost::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY:
- DCHECK(ExtensionSystem::GetForBrowserContext(browser_context_)->
- extension_service()->IsBackgroundPageReady(extension_));
- LoadInitialURL();
- break;
case chrome::NOTIFICATION_EXTENSION_UNLOADED:
// 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
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/extensions/extension_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698