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

Unified Diff: ui/views/window/dialog_delegate.cc

Issue 2375843003: views: add Harmony dialog width support (Closed)
Patch Set: GetPreferredSize -> DialogClientView Created 4 years, 2 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
« ui/views/window/dialog_delegate.h ('K') | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index d98274cde71a90871a5fd96875f70838ca61cb3f..c966d6a3b323e410ca96da14efe31c7a9494190d 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -10,6 +10,7 @@
#include "build/build_config.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/gfx/color_palette.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/bubble/bubble_border.h"
@@ -224,6 +225,12 @@ DialogClientView* DialogDelegate::GetDialogClientView() {
return GetWidget()->client_view()->AsDialogClientView();
}
+int DialogDelegate::GetWidthFactor() const {
+ if (!ui::MaterialDesignController::IsSecondaryUiMaterial())
+ return 0;
+ return static_cast<int>(dialog_width_);
+}
+
ui::AXRole DialogDelegate::GetAccessibleWindowRole() const {
return ui::AX_ROLE_DIALOG;
}
« ui/views/window/dialog_delegate.h ('K') | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698