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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 // MdTextButton, make it so. Note that some overrides may not always update | 276 // MdTextButton, make it so. Note that some overrides may not always update |
| 277 // the title (they should). See http://crbug.com/697303 . | 277 // the title (they should). See http://crbug.com/697303 . |
| 278 const base::string16 title = delegate->GetDialogButtonLabel(type); | 278 const base::string16 title = delegate->GetDialogButtonLabel(type); |
| 279 LabelButton* button = nullptr; | 279 LabelButton* button = nullptr; |
| 280 | 280 |
| 281 const bool is_default = delegate->GetDefaultDialogButton() == type && | 281 const bool is_default = delegate->GetDefaultDialogButton() == type && |
| 282 (type != ui::DIALOG_BUTTON_CANCEL || | 282 (type != ui::DIALOG_BUTTON_CANCEL || |
| 283 PlatformStyle::kDialogDefaultButtonCanBeCancel); | 283 PlatformStyle::kDialogDefaultButtonCanBeCancel); |
| 284 | 284 |
| 285 // The default button is always blue in Harmony. | 285 // The default button is always blue in Harmony. |
| 286 if (is_default && (ui::MaterialDesignController::IsSecondaryUiMaterial() || | 286 button = is_default |
| 287 delegate->ShouldDefaultButtonBeBlue())) { | 287 ? MdTextButton::CreateSecondaryUiBlueButton(this, title) |
| 288 button = MdTextButton::CreateSecondaryUiBlueButton(this, title); | 288 : button = MdTextButton::CreateSecondaryUiButton(this, title); |
|
afakhry
2017/06/05 23:45:29
Oops .. fixed this.
| |
| 289 } else { | |
| 290 button = MdTextButton::CreateSecondaryUiButton(this, title); | |
| 291 } | |
| 292 | 289 |
| 293 const int minimum_width = LayoutProvider::Get()->GetDistanceMetric( | 290 const int minimum_width = LayoutProvider::Get()->GetDistanceMetric( |
| 294 views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH); | 291 views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH); |
| 295 button->SetMinSize(gfx::Size(minimum_width, 0)); | 292 button->SetMinSize(gfx::Size(minimum_width, 0)); |
| 296 | 293 |
| 297 button->SetGroup(kButtonGroup); | 294 button->SetGroup(kButtonGroup); |
| 298 | 295 |
| 299 *member = button; | 296 *member = button; |
| 300 } | 297 } |
| 301 | 298 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 | 436 |
| 440 if (extra_view_) | 437 if (extra_view_) |
| 441 return; | 438 return; |
| 442 | 439 |
| 443 extra_view_ = GetDialogDelegate()->CreateExtraView(); | 440 extra_view_ = GetDialogDelegate()->CreateExtraView(); |
| 444 if (extra_view_) | 441 if (extra_view_) |
| 445 extra_view_->SetGroup(kButtonGroup); | 442 extra_view_->SetGroup(kButtonGroup); |
| 446 } | 443 } |
| 447 | 444 |
| 448 } // namespace views | 445 } // namespace views |
| OLD | NEW |