| 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 #include "ui/wm/core/shadow_types.h" | |
| 17 | 16 |
| 18 namespace views { | 17 namespace views { |
| 19 | 18 |
| 20 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
| 21 // DialogDelegate: | 20 // DialogDelegate: |
| 22 | 21 |
| 23 DialogDelegate::~DialogDelegate() { | 22 DialogDelegate::~DialogDelegate() { |
| 24 } | 23 } |
| 25 | 24 |
| 26 // static | 25 // static |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 scoped_ptr<BubbleBorder> border(new BubbleBorder( | 158 scoped_ptr<BubbleBorder> border(new BubbleBorder( |
| 160 BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, SK_ColorRED)); | 159 BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, SK_ColorRED)); |
| 161 border->set_use_theme_background_color(true); | 160 border->set_use_theme_background_color(true); |
| 162 frame->SetBubbleBorder(border.Pass()); | 161 frame->SetBubbleBorder(border.Pass()); |
| 163 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); | 162 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); |
| 164 if (delegate) { | 163 if (delegate) { |
| 165 View* titlebar_view = delegate->CreateTitlebarExtraView(); | 164 View* titlebar_view = delegate->CreateTitlebarExtraView(); |
| 166 if (titlebar_view) | 165 if (titlebar_view) |
| 167 frame->SetTitlebarExtraView(titlebar_view); | 166 frame->SetTitlebarExtraView(titlebar_view); |
| 168 } | 167 } |
| 169 // TODO(msw): Add a matching shadow type and remove the bubble frame border? | 168 widget->SetHasActivationShadow(false); |
| 170 wm::SetShadowType(widget->GetNativeWindow(), wm::SHADOW_TYPE_NONE); | |
| 171 return frame; | 169 return frame; |
| 172 } | 170 } |
| 173 | 171 |
| 174 bool DialogDelegate::UseNewStyleForThisDialog() const { | 172 bool DialogDelegate::UseNewStyleForThisDialog() const { |
| 175 return true; | 173 return true; |
| 176 } | 174 } |
| 177 | 175 |
| 178 const DialogClientView* DialogDelegate::GetDialogClientView() const { | 176 const DialogClientView* DialogDelegate::GetDialogClientView() const { |
| 179 return GetWidget()->client_view()->AsDialogClientView(); | 177 return GetWidget()->client_view()->AsDialogClientView(); |
| 180 } | 178 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 207 | 205 |
| 208 const Widget* DialogDelegateView::GetWidget() const { | 206 const Widget* DialogDelegateView::GetWidget() const { |
| 209 return View::GetWidget(); | 207 return View::GetWidget(); |
| 210 } | 208 } |
| 211 | 209 |
| 212 View* DialogDelegateView::GetContentsView() { | 210 View* DialogDelegateView::GetContentsView() { |
| 213 return this; | 211 return this; |
| 214 } | 212 } |
| 215 | 213 |
| 216 } // namespace views | 214 } // namespace views |
| OLD | NEW |