Chromium Code Reviews| Index: ui/views/window/dialog_client_view.h |
| diff --git a/ui/views/window/dialog_client_view.h b/ui/views/window/dialog_client_view.h |
| index ad84e3625d28f2872d152c633688f05d422e4e64..4a560461650f49431e2baad92e0201b53de7e571 100644 |
| --- a/ui/views/window/dialog_client_view.h |
| +++ b/ui/views/window/dialog_client_view.h |
| @@ -5,6 +5,7 @@ |
| #ifndef UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| +#include "base/memory/scoped_ptr.h" |
| #include "ui/gfx/font.h" |
| #include "ui/views/controls/button/button.h" |
| #include "ui/views/focus/focus_manager.h" |
| @@ -13,7 +14,7 @@ |
| namespace views { |
| class DialogDelegate; |
| -class NativeTextButton; |
| +class TextButton; |
| class Widget; |
| namespace internal { |
| class RootView; |
| @@ -35,7 +36,12 @@ class VIEWS_EXPORT DialogClientView : public ClientView, |
| public ButtonListener, |
| public FocusChangeListener { |
| public: |
| - DialogClientView(Widget* widget, View* contents_view); |
| + enum Style { |
|
Ben Goodger (Google)
2012/09/17 22:37:26
You should not need to add this.
Mike Wittman
2012/09/21 22:53:18
I've removed the enum in favor of accepting StyleP
|
| + STYLE_NATIVE, |
| + STYLE_WEB |
| + }; |
| + |
| + DialogClientView(Widget* widget, View* contents_view, Style style); |
| virtual ~DialogClientView(); |
| // Adds the dialog buttons required by the supplied DialogDelegate to the |
| @@ -53,8 +59,8 @@ class VIEWS_EXPORT DialogClientView : public ClientView, |
| void CancelWindow(); |
| // Accessors in case the user wishes to adjust these buttons. |
| - NativeTextButton* ok_button() const { return ok_button_; } |
| - NativeTextButton* cancel_button() const { return cancel_button_; } |
| + TextButton* ok_button() const { return ok_button_; } |
|
Ben Goodger (Google)
2012/09/17 22:37:26
This is OK.
|
| + TextButton* cancel_button() const { return cancel_button_; } |
| // Overridden from View: |
| virtual void NativeViewHierarchyChanged( |
| @@ -77,7 +83,6 @@ class VIEWS_EXPORT DialogClientView : public ClientView, |
| protected: |
| // View overrides: |
| - virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| virtual void Layout() OVERRIDE; |
| virtual void ViewHierarchyChanged(bool is_add, View* parent, |
| @@ -90,6 +95,11 @@ class VIEWS_EXPORT DialogClientView : public ClientView, |
| const ui::Event& event) OVERRIDE; |
| private: |
| + struct StyleParams; |
| + |
| + // Create style parameter settings for the given style. |
| + static StyleParams* CreateStyleParams(Style style); |
| + |
| // Paint the size box in the bottom right corner of the window if it is |
| // resizable. |
| void PaintSizeBox(gfx::Canvas* canvas); |
| @@ -110,7 +120,7 @@ class VIEWS_EXPORT DialogClientView : public ClientView, |
| void LayoutContentsView(); |
| // Makes the specified button the default button. |
| - void SetDefaultButton(NativeTextButton* button); |
| + void SetDefaultButton(TextButton* button); |
| bool has_dialog_buttons() const { return ok_button_ || cancel_button_; } |
| @@ -126,12 +136,14 @@ class VIEWS_EXPORT DialogClientView : public ClientView, |
| // Updates focus listener. |
| void UpdateFocusListener(); |
| + scoped_ptr<const StyleParams> style_params_; |
| + |
| // The dialog buttons. |
| - NativeTextButton* ok_button_; |
| - NativeTextButton* cancel_button_; |
| + TextButton* ok_button_; |
| + TextButton* cancel_button_; |
| // The button that is currently the default button if any. |
| - NativeTextButton* default_button_; |
| + TextButton* default_button_; |
| // The button-level extra view, NULL unless the dialog delegate supplies one. |
| View* extra_view_; |