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

Unified Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc

Issue 719203003: Parent the AppInfoDialog using a ModalDialogHost Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/apps/app_info_dialog/app_info_dialog_views.cc
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
index 734f1f72633dd684c4e9a87fe29fe8017e6f3782..24d50bc082bb8c61cb32400f1ac002c82324bd0f 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -29,41 +29,21 @@
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
-void ShowAppInfoInAppList(gfx::NativeWindow parent,
- const gfx::Rect& app_list_bounds,
- Profile* profile,
- const extensions::Extension* app,
- const base::Closure& close_callback) {
- UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialogOpenedForType",
- app->GetType(),
- extensions::Manifest::NUM_LOAD_TYPES);
- UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialogOpenedForLocation",
- app->location(),
- extensions::Manifest::NUM_LOCATIONS);
-
- views::View* app_info_view = new AppInfoDialog(parent, profile, app);
+void ShowAppInfoModally(web_modal::ModalDialogHost* host,
+ const gfx::Size& size,
+ Profile* profile,
+ const extensions::Extension* app,
+ const base::Closure& close_callback) {
+ views::View* app_info_view = new AppInfoDialog(host, profile, app);
views::DialogDelegate* dialog =
CreateAppListContainerForView(app_info_view, close_callback);
views::Widget* dialog_widget =
- constrained_window::CreateBrowserModalDialogViews(dialog, parent);
- dialog_widget->SetBounds(app_list_bounds);
- dialog_widget->Show();
-}
-
-void ShowAppInfoInNativeDialog(gfx::NativeWindow parent,
- const gfx::Size& size,
- Profile* profile,
- const extensions::Extension* app,
- const base::Closure& close_callback) {
- views::View* app_info_view = new AppInfoDialog(parent, profile, app);
- views::DialogDelegate* dialog =
- CreateDialogContainerForView(app_info_view, size, close_callback);
- views::Widget* dialog_widget =
- constrained_window::CreateBrowserModalDialogViews(dialog, parent);
+ constrained_window::CreateModalDialogViews(dialog, host);
+ dialog_widget->SetBounds(gfx::Rect(host->GetDialogPosition(size), size));
dialog_widget->Show();
}
-AppInfoDialog::AppInfoDialog(gfx::NativeWindow parent_window,
+AppInfoDialog::AppInfoDialog(web_modal::ModalDialogHost* host,
Profile* profile,
const extensions::Extension* app)
: dialog_header_(NULL),
@@ -88,7 +68,7 @@ AppInfoDialog::AppInfoDialog(gfx::NativeWindow parent_window,
dialog_header_->SetBorder(views::Border::CreateSolidSidedBorder(
0, 0, kHorizontalSeparatorHeight, 0, app_list::kDialogSeparatorColor));
- dialog_footer_ = new AppInfoFooterPanel(parent_window, profile, app);
+ dialog_footer_ = new AppInfoFooterPanel(host->GetHostView(), profile, app);
dialog_footer_->SetBorder(views::Border::CreateSolidSidedBorder(
kHorizontalSeparatorHeight, 0, 0, 0, app_list::kDialogSeparatorColor));
if (!dialog_footer_->has_children()) {

Powered by Google App Engine
This is Rietveld 408576698