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

Side by Side Diff: ui/views/window/dialog_client_view.cc

Issue 2922263002: Fix style of profile error dialog. (Closed)
Patch Set: Remove ShouldDefaultButtonBeBlue() Created 3 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
« no previous file with comments | « ui/base/models/dialog_model.h ('k') | ui/views/window/dialog_delegate.h » ('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 #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
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
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
OLDNEW
« no previous file with comments | « ui/base/models/dialog_model.h ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698