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

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

Issue 2375843003: views: add Harmony dialog width support (Closed)
Patch Set: remove GetDialogWidth 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
Index: ui/views/window/dialog_delegate.h
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h
index c74f5461ab9f131376a6261deb563a448be75c49..b17d1845ce83faa475f8dc959925f7b769887c7c 100644
--- a/ui/views/window/dialog_delegate.h
+++ b/ui/views/window/dialog_delegate.h
@@ -31,7 +31,15 @@ class LabelButton;
///////////////////////////////////////////////////////////////////////////////
class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
public WidgetDelegate {
+ // These values are in the 32px units the Harmony spec uses.
Evan Stade 2016/10/03 19:04:19 nit: I don't really think we need to mention "harm
Elly Fong-Jones 2016/10/05 13:20:31 But even after we're done, I think people may want
public:
+ enum DialogWidth {
Evan Stade 2016/10/03 19:04:19 protected?
sky 2016/10/03 21:24:02 enum class and remove DIALOG_WIDTH from each name?
Evan Stade 2016/10/04 00:13:46 ahhhh, I forgot about this distinction. We do have
Elly Fong-Jones 2016/10/05 13:20:31 I don't understand this suggestion - aren't many d
Evan Stade 2016/10/05 19:52:28 I assume you meant to delete this comment
+ DIALOG_WIDTH_UNSPECIFIED,
+ DIALOG_WIDTH_SMALL = 10,
+ DIALOG_WIDTH_MEDIUM = 14,
+ DIALOG_WIDTH_LARGE = 16,
+ };
+
DialogDelegate();
~DialogDelegate() override;
@@ -117,10 +125,16 @@ class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
// Overridden from WidgetDelegate:
ui::AXRole GetAccessibleWindowRole() const override;
+ DialogWidth dialog_width() const { return dialog_width_; }
Evan Stade 2016/10/03 19:04:19 this getter doesn't seem necessary
Elly Fong-Jones 2016/10/05 13:20:31 It was only necessary because the member was priva
+ void set_dialog_width(DialogWidth width) { dialog_width_ = width; }
+
private:
// A flag indicating whether this dialog is able to use the custom frame
// style for dialogs.
bool supports_custom_frame_;
+
+ // The Harmony width to use for this dialog.
Evan Stade 2016/10/03 19:04:19 s/Harmony //
+ DialogWidth dialog_width_ = DIALOG_WIDTH_UNSPECIFIED;
};
// A DialogDelegate implementation that is-a View. Used to override GetWidget()
@@ -143,6 +157,7 @@ class VIEWS_EXPORT DialogDelegateView : public DialogDelegate,
void GetAccessibleState(ui::AXViewState* state) override;
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
+ gfx::Size GetPreferredSize() const override;
private:
DISALLOW_COPY_AND_ASSIGN(DialogDelegateView);

Powered by Google App Engine
This is Rietveld 408576698