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

Unified Diff: chrome/browser/ui/views/extensions/extension_dialog.cc

Issue 10961066: Revert 158199 - extensions: Add ExtensionView interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/extensions/extension_dialog.cc
===================================================================
--- chrome/browser/ui/views/extensions/extension_dialog.cc (revision 158218)
+++ chrome/browser/ui/views/extensions/extension_dialog.cc (working copy)
@@ -9,7 +9,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/base_window.h"
#include "chrome/browser/ui/views/extensions/extension_dialog_observer.h"
-#include "chrome/browser/ui/views/extensions/extension_view_views.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
@@ -43,8 +42,6 @@
// Listen for a crash or other termination of the extension process.
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
content::Source<Profile>(host->profile()));
-
- view_ = static_cast<ExtensionViewViews*>(host->GetExtensionView());
}
ExtensionDialog::~ExtensionDialog() {
@@ -104,6 +101,12 @@
else
dialog->InitWindow(base_window, width, height);
+ // Show a white background while the extension loads. This is prettier than
+ // flashing a black unfilled window frame.
+ host->view()->set_background(
+ views::Background::CreateSolidBackground(0xFF, 0xFF, 0xFF));
+ host->view()->SetVisible(true);
+
// Ensure the DOM JavaScript can respond immediately to keyboard shortcuts.
host->host_contents()->Focus();
return dialog;
@@ -141,12 +144,6 @@
// TODO(jamescook): Remove redundant call to Activate()?
window_->Activate();
-
- // Show a white background while the extension loads. This is prettier than
- // flashing a black unfilled window frame.
- view_->set_background(
- views::Background::CreateSolidBackground(0xFF, 0xFF, 0xFF));
- view_->SetVisible(true);
}
#else
void ExtensionDialog::InitWindowFullscreen() {
@@ -175,12 +172,6 @@
window_->Show();
// TODO(jamescook): Remove redundant call to Activate()?
window_->Activate();
-
- // Show a white background while the extension loads. This is prettier than
- // flashing a black unfilled window frame.
- view_->set_background(
- views::Background::CreateSolidBackground(0xFF, 0xFF, 0xFF));
- view_->SetVisible(true);
}
void ExtensionDialog::ObserverDestroyed() {
@@ -220,11 +211,11 @@
bool ExtensionDialog::CanResize() const {
// Can resize only if minimum contents size set.
- return view_->GetPreferredSize() != gfx::Size();
+ return extension_host_->view()->GetPreferredSize() != gfx::Size();
}
void ExtensionDialog::SetMinimumContentsSize(int width, int height) {
- view_->SetPreferredSize(gfx::Size(width, height));
+ extension_host_->view()->SetPreferredSize(gfx::Size(width, height));
}
ui::ModalType ExtensionDialog::GetModalType() const {
@@ -250,15 +241,15 @@
}
views::Widget* ExtensionDialog::GetWidget() {
- return view_->GetWidget();
+ return extension_host_->view()->GetWidget();
}
const views::Widget* ExtensionDialog::GetWidget() const {
- return view_->GetWidget();
+ return extension_host_->view()->GetWidget();
}
views::View* ExtensionDialog::GetContentsView() {
- return view_;
+ return extension_host_->view();
}
/////////////////////////////////////////////////////////////////////////////
@@ -271,7 +262,7 @@
case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING:
// Avoid potential overdraw by removing the temporary background after
// the extension finishes loading.
- view_->set_background(NULL);
+ extension_host_->view()->set_background(NULL);
// The render view is created during the LoadURL(), so we should
// set the focus to the view if nobody else takes the focus.
if (content::Details<extensions::ExtensionHost>(host()) == details)
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_dialog.h ('k') | chrome/browser/ui/views/extensions/extension_popup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698