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

Unified Diff: chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_contents_view.cc

Issue 306023011: Add new DialogDelegate for dialogs in the App List (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split into separate files, fixed unittest and removed no-longer-needed overlay from AppList Created 6 years, 6 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/app_list/app_list_dialog/app_list_dialog_contents_view.cc
diff --git a/chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_contents_view.cc b/chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_contents_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2130c575479932f515b1c33db2695e71217f1b7b
--- /dev/null
+++ b/chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_contents_view.cc
@@ -0,0 +1,83 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_contents_view.h"
+
+#include "chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_client_view.h"
+#include "chrome/browser/ui/views/app_list/app_list_dialog/app_list_dialog_non_client_view.h"
+#include "ui/gfx/geometry/rect.h"
+
+AppListDialogContentsView::AppListDialogContentsView() {
+}
+
+AppListDialogContentsView::~AppListDialogContentsView() {
+}
+
+// static
+views::Widget* AppListDialogContentsView::CreateDialogWidget(
+ AppListDialogContentsView* dialog,
+ gfx::NativeView parent,
+ gfx::Rect bounds) {
+ views::Widget::InitParams params;
+ params.delegate = dialog;
+ params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
tapted 2014/06/11 08:34:59 does INFER_OPACITY do the wrong thing?
sashab 2014/06/12 00:13:43 I just copied this from the DialogDelegate equival
+ params.remove_standard_frame = true;
+ params.context = NULL;
tapted 2014/06/11 08:34:59 nit: no need to assign to the default value
sashab 2014/06/12 00:13:43 Done.
+ params.parent = parent;
+ params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
+ params.bounds = bounds;
+ // TODO(sashab): Plumb wm::WindowVisibilityAnimationType through to the
+ // NativeWindow so that widgets can specify custom animations for their
+ // windows. Then specify a matching animation for this type of widget,
+ // such as WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL.
+
+ views::Widget* widget = new views::Widget();
+ widget->Init(params);
+ return widget;
+}
+
+void AppListDialogContentsView::OnClosed() {
+}
+
+views::View* AppListDialogContentsView::GetInitiallyFocusedView() {
+ return GetContentsView();
+}
+
+views::ClientView* AppListDialogContentsView::CreateClientView(
+ views::Widget* widget) {
+ return new AppListDialogClientView(widget, GetContentsView());
+}
+
+views::NonClientFrameView* AppListDialogContentsView::CreateNonClientFrameView(
+ views::Widget* widget) {
+ return new AppListDialogNonClientView();
+}
+
+void AppListDialogContentsView::DeleteDelegate() {
+ delete this;
+}
+
+views::Widget* AppListDialogContentsView::GetWidget() {
+ return views::View::GetWidget();
+}
+
+const views::Widget* AppListDialogContentsView::GetWidget() const {
+ return views::View::GetWidget();
+}
+
+views::View* AppListDialogContentsView::GetContentsView() {
+ return this;
+}
+
+void AppListDialogContentsView::WindowClosing() {
+ OnClosed();
+}
+
+ui::AXRole AppListDialogContentsView::GetAccessibleWindowRole() const {
+ return ui::AX_ROLE_DIALOG;
+}
+
+ui::ModalType AppListDialogContentsView::GetModalType() const {
+ return ui::MODAL_TYPE_WINDOW;
+}

Powered by Google App Engine
This is Rietveld 408576698