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

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

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test for Mac Created 7 years, 5 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
diff --git a/chrome/browser/ui/views/extensions/extension_dialog.cc b/chrome/browser/ui/views/extensions/extension_dialog.cc
index 8ceff2f6a341adf8470dedf8663f9e38bcd8dff9..2dac704dd494fe7541e7882411c2c51a4e02b63e 100644
--- a/chrome/browser/ui/views/extensions/extension_dialog.cc
+++ b/chrome/browser/ui/views/extensions/extension_dialog.cc
@@ -27,8 +27,7 @@ using content::WebContents;
ExtensionDialog::ExtensionDialog(extensions::ExtensionHost* host,
ExtensionDialogObserver* observer)
- : window_(NULL),
- extension_host_(host),
+ : extension_host_(host),
observer_(observer) {
AddRef(); // Balanced in DeleteDelegate();
@@ -99,7 +98,7 @@ void ExtensionDialog::InitWindow(ui::BaseWindow* base_window,
int width,
int height) {
gfx::NativeWindow parent = base_window->GetNativeWindow();
- window_ = CreateBrowserModalDialogViews(this, parent);
+ views::Widget* window = CreateBrowserModalDialogViews(this, parent);
// Center the window over the browser.
gfx::Point center = base_window->GetBounds().CenterPoint();
@@ -111,25 +110,17 @@ void ExtensionDialog::InitWindow(ui::BaseWindow* base_window,
GetDisplayNearestPoint(center).bounds();
gfx::Rect bounds_rect = gfx::Rect(x, y, width, height);
bounds_rect.AdjustToFit(screen_rect);
- window_->SetBounds(bounds_rect);
+ window->SetBounds(bounds_rect);
- window_->Show();
+ window->Show();
// TODO(jamescook): Remove redundant call to Activate()?
- window_->Activate();
+ window->Activate();
}
void ExtensionDialog::ObserverDestroyed() {
observer_ = NULL;
}
-void ExtensionDialog::Close() {
- if (!window_)
- return;
-
- window_->Close();
- window_ = NULL;
-}
-
void ExtensionDialog::MaybeFocusRenderView() {
views::FocusManager* focus_manager = GetWidget()->GetFocusManager();
DCHECK(focus_manager != NULL);
@@ -225,7 +216,7 @@ void ExtensionDialog::Observe(int type,
// If we aren't the host of the popup, then disregard the notification.
if (content::Details<extensions::ExtensionHost>(host()) != details)
return;
- Close();
+ GetWidget()->Close();
break;
case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED:
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/javascript_app_modal_dialog_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698