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

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

Issue 2922263002: Fix style of profile error dialog. (Closed)
Patch Set: nit 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // should be responsible for the rest. TODO(tapted): When there is only 275 // should be responsible for the rest. TODO(tapted): When there is only
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 button = is_default ? MdTextButton::CreateSecondaryUiBlueButton(this, title)
286 if (is_default && (ui::MaterialDesignController::IsSecondaryUiMaterial() || 286 : MdTextButton::CreateSecondaryUiButton(this, title);
sky 2017/06/06 00:00:49 I'm assuming we don't care about ui::MaterialDesig
afakhry 2017/06/06 00:20:35 Right, in this instance we don't, as we want the d
287 delegate->ShouldDefaultButtonBeBlue())) {
288 button = MdTextButton::CreateSecondaryUiBlueButton(this, title);
289 } else {
290 button = MdTextButton::CreateSecondaryUiButton(this, title);
291 }
292 287
293 const int minimum_width = LayoutProvider::Get()->GetDistanceMetric( 288 const int minimum_width = LayoutProvider::Get()->GetDistanceMetric(
294 views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH); 289 views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH);
295 button->SetMinSize(gfx::Size(minimum_width, 0)); 290 button->SetMinSize(gfx::Size(minimum_width, 0));
296 291
297 button->SetGroup(kButtonGroup); 292 button->SetGroup(kButtonGroup);
298 293
299 *member = button; 294 *member = button;
300 } 295 }
301 296
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 434
440 if (extra_view_) 435 if (extra_view_)
441 return; 436 return;
442 437
443 extra_view_ = GetDialogDelegate()->CreateExtraView(); 438 extra_view_ = GetDialogDelegate()->CreateExtraView();
444 if (extra_view_) 439 if (extra_view_)
445 extra_view_->SetGroup(kButtonGroup); 440 extra_view_->SetGroup(kButtonGroup);
446 } 441 }
447 442
448 } // namespace views 443 } // 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