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 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further renaming 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
« ui/views/view.h ('K') | « 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,
174 BubbleBorder::NO_SHADOW_OPAQUE_BORDER, 174 BubbleBorder::NO_SHADOW_OPAQUE_BORDER,
175 color)); 175 color)));
176 } else { 176 } else {
177 frame->SetBubbleBorder(new BubbleBorder(BubbleBorder::FLOAT, 177 frame->SetBubbleBorder(scoped_ptr<BubbleBorder>(new BubbleBorder(
178 BubbleBorder::SMALL_SHADOW, 178 BubbleBorder::FLOAT,
179 color)); 179 BubbleBorder::SMALL_SHADOW,
180 color)));
180 } 181 }
181 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate(); 182 DialogDelegate* delegate = widget->widget_delegate()->AsDialogDelegate();
182 if (delegate) { 183 if (delegate) {
183 View* titlebar_view = delegate->CreateTitlebarExtraView(); 184 View* titlebar_view = delegate->CreateTitlebarExtraView();
184 if (titlebar_view) 185 if (titlebar_view)
185 frame->SetTitlebarExtraView(titlebar_view); 186 frame->SetTitlebarExtraView(titlebar_view);
186 } 187 }
187 if (force_opaque_border) 188 if (force_opaque_border)
188 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); 189 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM);
189 #if defined(USE_AURA) 190 #if defined(USE_AURA)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 230
230 const Widget* DialogDelegateView::GetWidget() const { 231 const Widget* DialogDelegateView::GetWidget() const {
231 return View::GetWidget(); 232 return View::GetWidget();
232 } 233 }
233 234
234 View* DialogDelegateView::GetContentsView() { 235 View* DialogDelegateView::GetContentsView() {
235 return this; 236 return this;
236 } 237 }
237 238
238 } // namespace views 239 } // namespace views
OLDNEW
« ui/views/view.h ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698