Chromium Code Reviews| 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/base/material_design/material_design_controller.h" | 10 #include "ui/base/material_design/material_design_controller.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 delegate_allowed_close_ = true; | 101 delegate_allowed_close_ = true; |
| 102 GetWidget()->Close(); | 102 GetWidget()->Close(); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 void DialogClientView::UpdateDialogButtons() { | 106 void DialogClientView::UpdateDialogButtons() { |
| 107 SetupLayout(); | 107 SetupLayout(); |
| 108 InvalidateLayout(); | 108 InvalidateLayout(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void DialogClientView::SetButtonRowInsets(const gfx::Insets& insets) { | |
| 112 button_row_insets_ = insets; | |
| 113 if (button_row_container_->has_children()) | |
|
sky
2017/05/14 16:01:16
Why do you make this conditional on whether there
djacobo
2017/05/16 01:10:25
Initially I thought that not having an ok_button_
| |
| 114 UpdateDialogButtons(); | |
| 115 } | |
| 116 | |
| 111 /////////////////////////////////////////////////////////////////////////////// | 117 /////////////////////////////////////////////////////////////////////////////// |
| 112 // DialogClientView, ClientView overrides: | 118 // DialogClientView, ClientView overrides: |
| 113 | 119 |
| 114 bool DialogClientView::CanClose() { | 120 bool DialogClientView::CanClose() { |
| 115 // If the dialog is closing but no Accept or Cancel action has been performed | 121 // If the dialog is closing but no Accept or Cancel action has been performed |
| 116 // before, it's a Close action. | 122 // before, it's a Close action. |
| 117 if (!delegate_allowed_close_) | 123 if (!delegate_allowed_close_) |
| 118 delegate_allowed_close_ = GetDialogDelegate()->Close(); | 124 delegate_allowed_close_ = GetDialogDelegate()->Close(); |
| 119 return delegate_allowed_close_; | 125 return delegate_allowed_close_; |
| 120 } | 126 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 | 427 |
| 422 if (extra_view_) | 428 if (extra_view_) |
| 423 return; | 429 return; |
| 424 | 430 |
| 425 extra_view_ = GetDialogDelegate()->CreateExtraView(); | 431 extra_view_ = GetDialogDelegate()->CreateExtraView(); |
| 426 if (extra_view_) | 432 if (extra_view_) |
| 427 extra_view_->SetGroup(kButtonGroup); | 433 extra_view_->SetGroup(kButtonGroup); |
| 428 } | 434 } |
| 429 | 435 |
| 430 } // namespace views | 436 } // namespace views |
| OLD | NEW |