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

Side by Side Diff: ui/views/window/dialog_delegate.h

Issue 2750063002: views: implement dialog width snapping (Closed)
Patch Set: width -> min_width and improve tests Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ 5 #ifndef UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_
6 #define UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ 6 #define UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // Returns true if this particular dialog should use a Chrome-styled frame 111 // Returns true if this particular dialog should use a Chrome-styled frame
112 // like the one used for bubbles. The alternative is a more platform-native 112 // like the one used for bubbles. The alternative is a more platform-native
113 // frame. 113 // frame.
114 virtual bool ShouldUseCustomFrame() const; 114 virtual bool ShouldUseCustomFrame() const;
115 115
116 // A helper for accessing the DialogClientView object contained by this 116 // A helper for accessing the DialogClientView object contained by this
117 // delegate's Window. 117 // delegate's Window.
118 const DialogClientView* GetDialogClientView() const; 118 const DialogClientView* GetDialogClientView() const;
119 DialogClientView* GetDialogClientView(); 119 DialogClientView* GetDialogClientView();
120 120
121 // Returns true if this dialog should have its width snapped. The default
122 // implementation always returns true.
123 virtual bool ShouldSnapFrameWidth() const;
124
121 protected: 125 protected:
122 // Overridden from WidgetDelegate: 126 // Overridden from WidgetDelegate:
123 ui::AXRole GetAccessibleWindowRole() const override; 127 ui::AXRole GetAccessibleWindowRole() const override;
124 128
125 private: 129 private:
126 // A flag indicating whether this dialog is able to use the custom frame 130 // A flag indicating whether this dialog is able to use the custom frame
127 // style for dialogs. 131 // style for dialogs.
128 bool supports_custom_frame_; 132 bool supports_custom_frame_;
129 }; 133 };
130 134
(...skipping 18 matching lines...) Expand all
149 void ViewHierarchyChanged( 153 void ViewHierarchyChanged(
150 const ViewHierarchyChangedDetails& details) override; 154 const ViewHierarchyChangedDetails& details) override;
151 155
152 private: 156 private:
153 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); 157 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView);
154 }; 158 };
155 159
156 } // namespace views 160 } // namespace views
157 161
158 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ 162 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698