| OLD | NEW |
| 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 #include "ui/views/window/dialog_client_view.h" | 5 #include "ui/views/window/dialog_client_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/base/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
| 10 #include "ui/views/controls/button/label_button.h" | 10 #include "ui/views/controls/button/label_button.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 cancel_button_ ? cancel_button_->GetPreferredSize().height() : 0); | 365 cancel_button_ ? cancel_button_->GetPreferredSize().height() : 0); |
| 366 return std::max(extra_view_height, buttons_height); | 366 return std::max(extra_view_height, buttons_height); |
| 367 } | 367 } |
| 368 | 368 |
| 369 gfx::Insets DialogClientView::GetButtonRowInsets() const { | 369 gfx::Insets DialogClientView::GetButtonRowInsets() const { |
| 370 if (GetButtonsAndExtraViewRowHeight() == 0) | 370 if (GetButtonsAndExtraViewRowHeight() == 0) |
| 371 return gfx::Insets(); | 371 return gfx::Insets(); |
| 372 | 372 |
| 373 // NOTE: The insets only apply to the buttons, extra view, and footnote view. | 373 // NOTE: The insets only apply to the buttons, extra view, and footnote view. |
| 374 return DialogDelegate::UseNewStyle() ? | 374 return DialogDelegate::UseNewStyle() ? |
| 375 gfx::Insets(0, 20, 20, 20) : | 375 gfx::Insets(0, kButtonHEdgeMarginNew, |
| 376 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew) : |
| 376 gfx::Insets(0, kButtonHEdgeMargin, | 377 gfx::Insets(0, kButtonHEdgeMargin, |
| 377 kButtonVEdgeMargin, kButtonHEdgeMargin); | 378 kButtonVEdgeMargin, kButtonHEdgeMargin); |
| 378 } | 379 } |
| 379 | 380 |
| 380 void DialogClientView::Close() { | 381 void DialogClientView::Close() { |
| 381 GetWidget()->Close(); | 382 GetWidget()->Close(); |
| 382 GetDialogDelegate()->OnClose(); | 383 GetDialogDelegate()->OnClose(); |
| 383 } | 384 } |
| 384 | 385 |
| 385 } // namespace views | 386 } // namespace views |
| OLD | NEW |