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

Side by Side Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 2571613002: Convert Register Protocol Handler dialog for Harmony/Material Design (Closed)
Patch Set: Fixes from feedback Created 3 years, 11 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
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 "chrome/browser/ui/views/chrome_views_delegate.h" 5 #include "chrome/browser/ui/views/chrome_views_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit); 541 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit);
542 return ViewsDelegate::GetDialogButtonInsets(); 542 return ViewsDelegate::GetDialogButtonInsets();
543 } 543 }
544 544
545 int ChromeViewsDelegate::GetDialogRelatedButtonHorizontalSpacing() { 545 int ChromeViewsDelegate::GetDialogRelatedButtonHorizontalSpacing() {
546 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) 546 if (ui::MaterialDesignController::IsSecondaryUiMaterial())
547 return HarmonyLayoutDelegate::kHarmonyLayoutUnit / 2; 547 return HarmonyLayoutDelegate::kHarmonyLayoutUnit / 2;
548 return ViewsDelegate::GetDialogRelatedButtonHorizontalSpacing(); 548 return ViewsDelegate::GetDialogRelatedButtonHorizontalSpacing();
549 } 549 }
550 550
551 int ChromeViewsDelegate::GetDialogRelatedControlVerticalSpacing() {
552 if (ui::MaterialDesignController::IsSecondaryUiMaterial())
553 return HarmonyLayoutDelegate::kHarmonyLayoutUnit / 2;
554 return ViewsDelegate::GetDialogRelatedControlVerticalSpacing();
555 }
556
551 gfx::Insets ChromeViewsDelegate::GetDialogFrameViewInsets() { 557 gfx::Insets ChromeViewsDelegate::GetDialogFrameViewInsets() {
552 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { 558 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
553 // Titles are inset at the top and sides, but not at the bottom. 559 // Titles are inset at the top and sides, but not at the bottom.
554 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit, 560 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit,
555 HarmonyLayoutDelegate::kHarmonyLayoutUnit, 0, 561 HarmonyLayoutDelegate::kHarmonyLayoutUnit, 0,
556 HarmonyLayoutDelegate::kHarmonyLayoutUnit); 562 HarmonyLayoutDelegate::kHarmonyLayoutUnit);
557 } 563 }
558 return ViewsDelegate::GetDialogFrameViewInsets(); 564 return ViewsDelegate::GetDialogFrameViewInsets();
559 } 565 }
560 566
567 gfx::Insets ChromeViewsDelegate::GetBubbleDialogMargins() {
568 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
569 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit,
msw 2017/01/06 23:17:43 optional nit: use the ctor that takes one |all| ar
kylix_rd 2017/01/10 14:36:44 Done.
570 HarmonyLayoutDelegate::kHarmonyLayoutUnit,
571 HarmonyLayoutDelegate::kHarmonyLayoutUnit,
572 HarmonyLayoutDelegate::kHarmonyLayoutUnit);
573 }
574 return ViewsDelegate::GetBubbleDialogMargins();
575 }
576
561 #if !defined(USE_ASH) 577 #if !defined(USE_ASH)
562 views::Widget::InitParams::WindowOpacity 578 views::Widget::InitParams::WindowOpacity
563 ChromeViewsDelegate::GetOpacityForInitParams( 579 ChromeViewsDelegate::GetOpacityForInitParams(
564 const views::Widget::InitParams& params) { 580 const views::Widget::InitParams& params) {
565 return views::Widget::InitParams::OPAQUE_WINDOW; 581 return views::Widget::InitParams::OPAQUE_WINDOW;
566 } 582 }
567 #endif 583 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698