OLD | NEW |
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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/views/bubble/bubble_border.h" | 10 #include "ui/views/bubble/bubble_border.h" |
11 #include "ui/views/bubble/bubble_frame_view.h" | 11 #include "ui/views/bubble/bubble_frame_view.h" |
12 #include "ui/views/controls/button/label_button.h" | 12 #include "ui/views/controls/button/label_button.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 #include "ui/views/widget/widget_observer.h" | 14 #include "ui/views/widget/widget_observer.h" |
15 #include "ui/views/window/dialog_client_view.h" | 15 #include "ui/views/window/dialog_client_view.h" |
16 | 16 |
17 #if defined(USE_AURA) | |
18 #include "ui/wm/core/shadow_types.h" | |
19 #endif | |
20 | |
21 namespace views { | 17 namespace views { |
22 | 18 |
23 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
24 // DialogDelegate: | 20 // DialogDelegate: |
25 | 21 |
26 DialogDelegate::~DialogDelegate() { | 22 DialogDelegate::~DialogDelegate() { |
27 } | 23 } |
28 | 24 |
29 // static | 25 // static |
30 Widget* DialogDelegate::CreateDialogWidget(DialogDelegate* dialog, | 26 Widget* DialogDelegate::CreateDialogWidget(DialogDelegate* dialog, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 const SkColor color = widget->GetNativeTheme()->GetSystemColor( | 158 const SkColor color = widget->GetNativeTheme()->GetSystemColor( |
163 ui::NativeTheme::kColorId_DialogBackground); | 159 ui::NativeTheme::kColorId_DialogBackground); |
164 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>(new BubbleBorder( | 160 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>(new BubbleBorder( |
165 BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, color))); | 161 BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, color))); |
166 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); | 162 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); |
167 if (delegate) { | 163 if (delegate) { |
168 View* titlebar_view = delegate->CreateTitlebarExtraView(); | 164 View* titlebar_view = delegate->CreateTitlebarExtraView(); |
169 if (titlebar_view) | 165 if (titlebar_view) |
170 frame->SetTitlebarExtraView(titlebar_view); | 166 frame->SetTitlebarExtraView(titlebar_view); |
171 } | 167 } |
172 #if defined(USE_AURA) | 168 widget->SetHasShadow(false); |
173 // TODO(msw): Add a matching shadow type and remove the bubble frame border? | |
174 wm::SetShadowType(widget->GetNativeWindow(), wm::SHADOW_TYPE_NONE); | |
175 #endif | |
176 return frame; | 169 return frame; |
177 } | 170 } |
178 | 171 |
179 bool DialogDelegate::UseNewStyleForThisDialog() const { | 172 bool DialogDelegate::UseNewStyleForThisDialog() const { |
180 return true; | 173 return true; |
181 } | 174 } |
182 | 175 |
183 const DialogClientView* DialogDelegate::GetDialogClientView() const { | 176 const DialogClientView* DialogDelegate::GetDialogClientView() const { |
184 return GetWidget()->client_view()->AsDialogClientView(); | 177 return GetWidget()->client_view()->AsDialogClientView(); |
185 } | 178 } |
(...skipping 26 matching lines...) Expand all Loading... |
212 | 205 |
213 const Widget* DialogDelegateView::GetWidget() const { | 206 const Widget* DialogDelegateView::GetWidget() const { |
214 return View::GetWidget(); | 207 return View::GetWidget(); |
215 } | 208 } |
216 | 209 |
217 View* DialogDelegateView::GetContentsView() { | 210 View* DialogDelegateView::GetContentsView() { |
218 return this; | 211 return this; |
219 } | 212 } |
220 | 213 |
221 } // namespace views | 214 } // namespace views |
OLD | NEW |