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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/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 "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"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 // static 164 // static
165 NonClientFrameView* DialogDelegate::CreateDialogFrameView( 165 NonClientFrameView* DialogDelegate::CreateDialogFrameView(
166 Widget* widget, 166 Widget* widget,
167 bool force_opaque_border) { 167 bool force_opaque_border) {
168 BubbleFrameView* frame = new BubbleFrameView(gfx::Insets()); 168 BubbleFrameView* frame = new BubbleFrameView(gfx::Insets());
169 const SkColor color = widget->GetNativeTheme()->GetSystemColor( 169 const SkColor color = widget->GetNativeTheme()->GetSystemColor(
170 ui::NativeTheme::kColorId_DialogBackground); 170 ui::NativeTheme::kColorId_DialogBackground);
171 if (force_opaque_border) { 171 if (force_opaque_border) {
172 frame->SetBubbleBorder(new BubbleBorder( 172 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>(new BubbleBorder(
173 BubbleBorder::NONE, 173 BubbleBorder::NONE, BubbleBorder::NO_SHADOW_OPAQUE_BORDER, color)));
174 BubbleBorder::NO_SHADOW_OPAQUE_BORDER,
175 color));
176 } else { 174 } else {
177 frame->SetBubbleBorder(new BubbleBorder(BubbleBorder::FLOAT, 175 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>(new BubbleBorder(
178 BubbleBorder::SMALL_SHADOW, 176 BubbleBorder::FLOAT, BubbleBorder::SMALL_SHADOW, color)));
179 color));
180 } 177 }
181 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); 178 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate();
182 if (delegate) { 179 if (delegate) {
183 View* titlebar_view = delegate->CreateTitlebarExtraView(); 180 View* titlebar_view = delegate->CreateTitlebarExtraView();
184 if (titlebar_view) 181 if (titlebar_view)
185 frame->SetTitlebarExtraView(titlebar_view); 182 frame->SetTitlebarExtraView(titlebar_view);
186 } 183 }
187 if (force_opaque_border) 184 if (force_opaque_border)
188 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); 185 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM);
189 #if defined(USE_AURA) 186 #if defined(USE_AURA)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 226
230 const Widget* DialogDelegateView::GetWidget() const { 227 const Widget* DialogDelegateView::GetWidget() const {
231 return View::GetWidget(); 228 return View::GetWidget();
232 } 229 }
233 230
234 View* DialogDelegateView::GetContentsView() { 231 View* DialogDelegateView::GetContentsView() {
235 return this; 232 return this;
236 } 233 }
237 234
238 } // namespace views 235 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698