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

Unified Diff: ui/views/bubble/bubble_dialog_delegate.cc

Issue 2571613002: Convert Register Protocol Handler dialog for Harmony/Material Design (Closed)
Patch Set: More fixed nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/login_view.cc ('k') | ui/views/layout/layout_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_dialog_delegate.cc
diff --git a/ui/views/bubble/bubble_dialog_delegate.cc b/ui/views/bubble/bubble_dialog_delegate.cc
index 369467778fe2b3512a34b6807e92fbfb9dcca4a6..59839479a40b04f1e4cf2c48deb5b9666dfede6f 100644
--- a/ui/views/bubble/bubble_dialog_delegate.cc
+++ b/ui/views/bubble/bubble_dialog_delegate.cc
@@ -6,6 +6,7 @@
#include "build/build_config.h"
#include "ui/accessibility/ax_node_data.h"
+#include "ui/base/default_style.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/color_utils.h"
@@ -15,6 +16,7 @@
#include "ui/views/focus/view_storage.h"
#include "ui/views/layout/layout_constants.h"
#include "ui/views/style/platform_style.h"
+#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/views/window/dialog_client_view.h"
@@ -102,8 +104,11 @@ ClientView* BubbleDialogDelegateView::CreateClientView(Widget* widget) {
NonClientFrameView* BubbleDialogDelegateView::CreateNonClientFrameView(
Widget* widget) {
+ ViewsDelegate* views_delegate = ViewsDelegate::GetInstance();
BubbleFrameView* frame = new BubbleFrameView(
- gfx::Insets(kPanelVertMargin, kPanelHorizMargin, 0, kPanelHorizMargin),
+ views_delegate ? views_delegate->GetDialogFrameViewInsets()
+ : gfx::Insets(kPanelVertMargin, kPanelHorizMargin, 0,
+ kPanelHorizMargin),
margins());
// Note: In CreateBubble, the call to SizeToContents() will cause
// the relayout that this call requires.
@@ -212,13 +217,13 @@ BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view,
mirror_arrow_in_rtl_(PlatformStyle::kMirrorBubbleArrowInRTLByDefault),
shadow_(BubbleBorder::SMALL_SHADOW),
color_explicitly_set_(false),
- margins_(kPanelVertMargin,
- kPanelHorizMargin,
- kPanelVertMargin,
- kPanelHorizMargin),
accept_events_(true),
adjust_if_offscreen_(true),
parent_window_(NULL) {
+ margins_ = ViewsDelegate::GetInstance()
+ ? ViewsDelegate::GetInstance()->GetBubbleDialogMargins()
+ : gfx::Insets(kPanelVertMargin, kPanelHorizMargin,
+ kPanelVertMargin, kPanelHorizMargin);
if (anchor_view)
SetAnchorView(anchor_view);
UpdateColorsFromTheme(GetNativeTheme());
@@ -235,6 +240,8 @@ gfx::Rect BubbleDialogDelegateView::GetBubbleBounds() {
const gfx::FontList& BubbleDialogDelegateView::GetTitleFontList() const {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial())
+ return rb.GetFontListWithDelta(ui::kTitleFontSizeDelta);
return rb.GetFontList(ui::ResourceBundle::MediumFont);
}
« no previous file with comments | « chrome/browser/ui/views/login_view.cc ('k') | ui/views/layout/layout_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698