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

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

Issue 2696263002: Refactor ViewsDelegate and MD-ify the icon-to-text spacing for checkbox and radiobutton (Closed)
Patch Set: Used ifdef instead of duplicated code for delegate initialization Created 3 years, 9 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/views/window/dialog_client_view.cc ('k') | no next file » | 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_delegate.h" 5 #include "ui/views/window/dialog_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) { 193 NonClientFrameView* DialogDelegate::CreateNonClientFrameView(Widget* widget) {
194 if (ShouldUseCustomFrame()) 194 if (ShouldUseCustomFrame())
195 return CreateDialogFrameView(widget, gfx::Insets()); 195 return CreateDialogFrameView(widget, gfx::Insets());
196 return WidgetDelegate::CreateNonClientFrameView(widget); 196 return WidgetDelegate::CreateNonClientFrameView(widget);
197 } 197 }
198 198
199 // static 199 // static
200 NonClientFrameView* DialogDelegate::CreateDialogFrameView( 200 NonClientFrameView* DialogDelegate::CreateDialogFrameView(
201 Widget* widget, 201 Widget* widget,
202 const gfx::Insets& content_margins) { 202 const gfx::Insets& content_margins) {
203 BubbleFrameView* frame = new BubbleFrameView( 203 BubbleFrameView* frame =
204 ViewsDelegate::GetInstance()->GetDialogFrameViewInsets(), 204 new BubbleFrameView(ViewsDelegate::GetInstance()->GetInsetsMetric(
205 content_margins); 205 InsetsMetric::DIALOG_FRAME_VIEW),
206 content_margins);
206 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; 207 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW;
207 std::unique_ptr<BubbleBorder> border( 208 std::unique_ptr<BubbleBorder> border(
208 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor)); 209 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor));
209 border->set_use_theme_background_color(true); 210 border->set_use_theme_background_color(true);
210 frame->SetBubbleBorder(std::move(border)); 211 frame->SetBubbleBorder(std::move(border));
211 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); 212 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate();
212 if (delegate) 213 if (delegate)
213 frame->SetFootnoteView(delegate->CreateFootnoteView()); 214 frame->SetFootnoteView(delegate->CreateFootnoteView());
214 return frame; 215 return frame;
215 } 216 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 node_data->role = ui::AX_ROLE_DIALOG; 262 node_data->role = ui::AX_ROLE_DIALOG;
262 } 263 }
263 264
264 void DialogDelegateView::ViewHierarchyChanged( 265 void DialogDelegateView::ViewHierarchyChanged(
265 const ViewHierarchyChangedDetails& details) { 266 const ViewHierarchyChangedDetails& details) {
266 if (details.is_add && details.child == this && GetWidget()) 267 if (details.is_add && details.child == this && GetWidget())
267 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 268 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
268 } 269 }
269 270
270 } // namespace views 271 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698