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

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

Issue 2550323004: views: support Harmony title insets (Closed)
Patch Set: Created 4 years 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 | « chrome/browser/ui/views/chrome_views_delegate.h ('k') | ui/views/views_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 "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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit); 537 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit);
538 return ViewsDelegate::GetDialogButtonInsets(); 538 return ViewsDelegate::GetDialogButtonInsets();
539 } 539 }
540 540
541 int ChromeViewsDelegate::GetDialogRelatedButtonHorizontalSpacing() { 541 int ChromeViewsDelegate::GetDialogRelatedButtonHorizontalSpacing() {
542 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) 542 if (ui::MaterialDesignController::IsSecondaryUiMaterial())
543 return HarmonyLayoutDelegate::kHarmonyLayoutUnit / 2; 543 return HarmonyLayoutDelegate::kHarmonyLayoutUnit / 2;
544 return ViewsDelegate::GetDialogRelatedButtonHorizontalSpacing(); 544 return ViewsDelegate::GetDialogRelatedButtonHorizontalSpacing();
545 } 545 }
546 546
547 gfx::Insets ChromeViewsDelegate::GetDialogFrameViewInsets() {
548 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
549 // Titles are inset at the top and sides, but not at the bottom.
550 return gfx::Insets(HarmonyLayoutDelegate::kHarmonyLayoutUnit,
551 HarmonyLayoutDelegate::kHarmonyLayoutUnit, 0,
552 HarmonyLayoutDelegate::kHarmonyLayoutUnit);
553 }
554 return ViewsDelegate::GetDialogFrameViewInsets();
555 }
556
547 #if !defined(USE_ASH) 557 #if !defined(USE_ASH)
548 views::Widget::InitParams::WindowOpacity 558 views::Widget::InitParams::WindowOpacity
549 ChromeViewsDelegate::GetOpacityForInitParams( 559 ChromeViewsDelegate::GetOpacityForInitParams(
550 const views::Widget::InitParams& params) { 560 const views::Widget::InitParams& params) {
551 return views::Widget::InitParams::OPAQUE_WINDOW; 561 return views::Widget::InitParams::OPAQUE_WINDOW;
552 } 562 }
553 #endif 563 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.h ('k') | ui/views/views_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698