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

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

Issue 11571023: Move ash/wm's DialogFrameView to ui/views/window; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorder DialogDelegate functions; inline Get*Params into WidgetExample::ButtonPressed; etc. Created 8 years 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
« no previous file with comments | « ui/views/window/dialog_client_view.h ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index b9bbc1910b954934105c52a7ec0174f915537487..df2c83b211bd10bcac58dd66efa6f16956d5cf53 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -113,19 +113,8 @@ template <> const char DialogButton<TextButton>::kViewClassName[] =
///////////////////////////////////////////////////////////////////////////////
// DialogClientView, public:
-DialogClientView::StyleParams::StyleParams()
- : button_vedge_margin(kButtonVEdgeMargin),
- button_hedge_margin(kButtonHEdgeMargin),
- button_shadow_margin(0),
- button_content_spacing(kDialogButtonContentSpacing),
- related_button_hspacing(kRelatedButtonHSpacing) {
-}
-
-DialogClientView::DialogClientView(Widget* owner,
- View* contents_view,
- const StyleParams &params)
+DialogClientView::DialogClientView(Widget* owner, View* contents_view)
: ClientView(owner, contents_view),
- style_params_(params),
ok_button_(NULL),
cancel_button_(NULL),
default_button_(NULL),
@@ -194,7 +183,7 @@ void DialogClientView::OnWillChangeFocus(View* focused_before,
// change once we move completely to Chrome style. See
// http://codereview.chromium.org/10230 for a rough idea of changes to be
// undone.
- if (GetDialogDelegate()->UseChromeStyle())
+ if (DialogDelegate::UseNewStyle())
return;
TextButton* new_default_button = NULL;
@@ -260,17 +249,6 @@ void DialogClientView::CancelWindow() {
Close();
}
-// static
-DialogClientView::StyleParams DialogClientView::GetChromeStyleParams() {
- StyleParams params;
- params.button_vedge_margin = 0;
- params.button_hedge_margin = 0;
- params.button_shadow_margin = views::GetChromeStyleButtonShadowMargin();
- params.button_content_spacing = 0;
- params.related_button_hspacing = 10;
- return params;
-}
-
int DialogClientView::GetBottomMargin() {
return style_params_.button_shadow_margin;
}
@@ -418,15 +396,30 @@ void DialogClientView::ButtonPressed(Button* sender, const ui::Event& event) {
////////////////////////////////////////////////////////////////////////////////
// DialogClientView, private:
+DialogClientView::StyleParams::StyleParams()
+ : button_vedge_margin(kButtonVEdgeMargin),
+ button_hedge_margin(kButtonHEdgeMargin),
+ button_shadow_margin(0),
+ button_content_spacing(kDialogButtonContentSpacing),
+ related_button_hspacing(kRelatedButtonHSpacing) {
+ if (DialogDelegate::UseNewStyle()) {
+ button_vedge_margin = 0;
+ button_hedge_margin = 0;
+ button_shadow_margin = GetChromeStyleButtonShadowMargin();
+ button_content_spacing = 0;
+ related_button_hspacing = 10;
+ }
+}
+
TextButton* DialogClientView::CreateDialogButton(ui::DialogButton type,
const string16& title) {
TextButton* button = NULL;
- if (GetDialogDelegate()->UseChromeStyle())
+ if (DialogDelegate::UseNewStyle())
button = new DialogButton<TextButton>(this, GetWidget(), type, title);
else
button = new DialogButton<NativeTextButton>(this, GetWidget(), type, title);
- if (!GetDialogDelegate()->UseChromeStyle())
+ if (!DialogDelegate::UseNewStyle())
button->set_min_width(kDialogMinButtonWidth);
button->SetGroup(kButtonGroup);
@@ -436,7 +429,7 @@ TextButton* DialogClientView::CreateDialogButton(ui::DialogButton type,
button->SetIsDefault(true);
}
- if (GetDialogDelegate()->UseChromeStyle())
+ if (DialogDelegate::UseNewStyle())
ApplyChromeStyle(button);
return button;
« no previous file with comments | « ui/views/window/dialog_client_view.h ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698