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

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

Issue 1717453003: Introduce BubbleDialogDelegateView, which extends DialogDelegateView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: relative ps Created 4 years, 10 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 "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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 View* DialogDelegate::CreateExtraView() { 89 View* DialogDelegate::CreateExtraView() {
90 return NULL; 90 return NULL;
91 } 91 }
92 92
93 bool DialogDelegate::GetExtraViewPadding(int* padding) { 93 bool DialogDelegate::GetExtraViewPadding(int* padding) {
94 return false; 94 return false;
95 } 95 }
96 96
97 View* DialogDelegate::CreateTitlebarExtraView() {
98 return NULL;
99 }
100
101 View* DialogDelegate::CreateFootnoteView() { 97 View* DialogDelegate::CreateFootnoteView() {
102 return NULL; 98 return NULL;
103 } 99 }
104 100
105 bool DialogDelegate::Cancel() { 101 bool DialogDelegate::Cancel() {
106 return true; 102 return true;
107 } 103 }
108 104
109 bool DialogDelegate::Accept(bool window_closing) { 105 bool DialogDelegate::Accept(bool window_closing) {
110 return Accept(); 106 return Accept();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 BubbleFrameView* frame = 195 BubbleFrameView* frame =
200 new BubbleFrameView(gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew, 196 new BubbleFrameView(gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew,
201 0, kButtonHEdgeMarginNew), 197 0, kButtonHEdgeMarginNew),
202 gfx::Insets()); 198 gfx::Insets());
203 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; 199 const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW;
204 scoped_ptr<BubbleBorder> border( 200 scoped_ptr<BubbleBorder> border(
205 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor)); 201 new BubbleBorder(BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor));
206 border->set_use_theme_background_color(true); 202 border->set_use_theme_background_color(true);
207 frame->SetBubbleBorder(std::move(border)); 203 frame->SetBubbleBorder(std::move(border));
208 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); 204 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate();
209 if (delegate) { 205 if (delegate)
210 frame->SetTitlebarExtraView( 206 frame->SetFootnoteView(delegate->CreateFootnoteView());
211 make_scoped_ptr(delegate->CreateTitlebarExtraView()));
212 }
213 return frame; 207 return frame;
214 } 208 }
215 209
216 bool DialogDelegate::UseNewStyleForThisDialog() const { 210 bool DialogDelegate::UseNewStyleForThisDialog() const {
217 return supports_new_style_; 211 return supports_new_style_;
218 } 212 }
219 213
220 const DialogClientView* DialogDelegate::GetDialogClientView() const { 214 const DialogClientView* DialogDelegate::GetDialogClientView() const {
221 return GetWidget()->client_view()->AsDialogClientView(); 215 return GetWidget()->client_view()->AsDialogClientView();
222 } 216 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 state->role = ui::AX_ROLE_DIALOG; 254 state->role = ui::AX_ROLE_DIALOG;
261 } 255 }
262 256
263 void DialogDelegateView::ViewHierarchyChanged( 257 void DialogDelegateView::ViewHierarchyChanged(
264 const ViewHierarchyChangedDetails& details) { 258 const ViewHierarchyChangedDetails& details) {
265 if (details.is_add && details.child == this && GetWidget()) 259 if (details.is_add && details.child == this && GetWidget())
266 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 260 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
267 } 261 }
268 262
269 } // namespace views 263 } // namespace views
OLDNEW
« ui/views/window/dialog_delegate.h ('K') | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698