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

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

Issue 15731007: Add dialog-specific styling, restore old-style task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/string16.h" 9 #include "base/string16.h"
10 #include "ui/base/accessibility/accessibility_types.h" 10 #include "ui/base/accessibility/accessibility_types.h"
(...skipping 13 matching lines...) Expand all
24 // dialog box Window. The window that is displayed uses this interface to 24 // dialog box Window. The window that is displayed uses this interface to
25 // determine how it should be displayed and notify the delegate object of 25 // determine how it should be displayed and notify the delegate object of
26 // certain events. 26 // certain events.
27 // 27 //
28 /////////////////////////////////////////////////////////////////////////////// 28 ///////////////////////////////////////////////////////////////////////////////
29 class VIEWS_EXPORT DialogDelegate : public ui::DialogModel, 29 class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
30 public WidgetDelegate { 30 public WidgetDelegate {
31 public: 31 public:
32 virtual ~DialogDelegate(); 32 virtual ~DialogDelegate();
33 33
34 // Returns whether to use the new dialog style. 34 // Returns whether to use the new dialog style in general.
35 // See UseNewStyleForThisDialog() for dialog-specific styling.
35 static bool UseNewStyle(); 36 static bool UseNewStyle();
36 37
37 // Create a |dialog| window Widget with the specified |context| or |parent|. 38 // Create a |dialog| window Widget with the specified |context| or |parent|.
38 static Widget* CreateDialogWidget(DialogDelegate* dialog, 39 static Widget* CreateDialogWidget(DialogDelegate* dialog,
39 gfx::NativeWindow context, 40 gfx::NativeWindow context,
40 gfx::NativeWindow parent); 41 gfx::NativeWindow parent);
41 42
42 // Override this function to display an extra view adjacent to the buttons. 43 // Override this function to display an extra view adjacent to the buttons.
43 // Overrides may construct the view; this will only be called once per dialog. 44 // Overrides may construct the view; this will only be called once per dialog.
44 virtual View* CreateExtraView(); 45 virtual View* CreateExtraView();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 static NonClientFrameView* CreateNewStyleFrameView(Widget* widget); 90 static NonClientFrameView* CreateNewStyleFrameView(Widget* widget);
90 // The semi-transparent border and shadow of the new style frame view does not 91 // The semi-transparent border and shadow of the new style frame view does not
91 // work on child windows under Views/Win32. This is a kludge to get a 92 // work on child windows under Views/Win32. This is a kludge to get a
92 // reasonable-looking opaque border for the dialog. Note that this does not 93 // reasonable-looking opaque border for the dialog. Note that this does not
93 // support arrows. 94 // support arrows.
94 // 95 //
95 // TODO(wittman): Remove once WinAura is in place. 96 // TODO(wittman): Remove once WinAura is in place.
96 static NonClientFrameView* CreateNewStyleFrameView(Widget* widget, 97 static NonClientFrameView* CreateNewStyleFrameView(Widget* widget,
97 bool force_opaque_border); 98 bool force_opaque_border);
98 99
100 // Returns whether this particular dialog should use the new dialog style.
101 virtual bool UseNewStyleForThisDialog() const;
102
99 // Called when the window has been closed. 103 // Called when the window has been closed.
100 virtual void OnClose() {} 104 virtual void OnClose() {}
101 105
102 // A helper for accessing the DialogClientView object contained by this 106 // A helper for accessing the DialogClientView object contained by this
103 // delegate's Window. 107 // delegate's Window.
104 const DialogClientView* GetDialogClientView() const; 108 const DialogClientView* GetDialogClientView() const;
105 DialogClientView* GetDialogClientView(); 109 DialogClientView* GetDialogClientView();
106 110
107 protected: 111 protected:
108 // Overridden from WidgetDelegate: 112 // Overridden from WidgetDelegate:
(...skipping 16 matching lines...) Expand all
125 virtual const Widget* GetWidget() const OVERRIDE; 129 virtual const Widget* GetWidget() const OVERRIDE;
126 virtual View* GetContentsView() OVERRIDE; 130 virtual View* GetContentsView() OVERRIDE;
127 131
128 private: 132 private:
129 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView); 133 DISALLOW_COPY_AND_ASSIGN(DialogDelegateView);
130 }; 134 };
131 135
132 } // namespace views 136 } // namespace views
133 137
134 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_ 138 #endif // UI_VIEWS_WINDOW_DIALOG_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698