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

Side by Side Diff: ui/views/bubble/bubble_frame_view.cc

Issue 659713003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify Created 6 years, 2 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
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_gbm.cc ('k') | ui/views/controls/button/checkbox.cc » ('j') | 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/bubble/bubble_frame_view.h" 5 #include "ui/views/bubble/bubble_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ui/base/hit_test.h" 9 #include "ui/base/hit_test.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 246 }
247 } 247 }
248 248
249 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { 249 void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) {
250 if (sender == close_) 250 if (sender == close_)
251 GetWidget()->Close(); 251 GetWidget()->Close();
252 } 252 }
253 253
254 void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) { 254 void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) {
255 bubble_border_ = border.get(); 255 bubble_border_ = border.get();
256 SetBorder(border.PassAs<Border>()); 256 SetBorder(border.Pass());
257 257
258 // Update the background, which relies on the border. 258 // Update the background, which relies on the border.
259 set_background(new views::BubbleBackground(bubble_border_)); 259 set_background(new views::BubbleBackground(bubble_border_));
260 } 260 }
261 261
262 void BubbleFrameView::SetTitlebarExtraView(View* view) { 262 void BubbleFrameView::SetTitlebarExtraView(View* view) {
263 DCHECK(view); 263 DCHECK(view);
264 DCHECK(!titlebar_extra_view_); 264 DCHECK(!titlebar_extra_view_);
265 AddChildView(view); 265 AddChildView(view);
266 titlebar_extra_view_ = view; 266 titlebar_extra_view_ = view;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 if (titlebar_extra_view_ != NULL) 378 if (titlebar_extra_view_ != NULL)
379 title_bar_width += titlebar_extra_view_->GetPreferredSize().width(); 379 title_bar_width += titlebar_extra_view_->GetPreferredSize().width();
380 gfx::Size size(client_size); 380 gfx::Size size(client_size);
381 size.SetToMax(gfx::Size(title_bar_width, 0)); 381 size.SetToMax(gfx::Size(title_bar_width, 0));
382 const gfx::Insets insets(GetInsets()); 382 const gfx::Insets insets(GetInsets());
383 size.Enlarge(insets.width(), insets.height()); 383 size.Enlarge(insets.width(), insets.height());
384 return size; 384 return size;
385 } 385 }
386 386
387 } // namespace views 387 } // namespace views
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/ozone_platform_gbm.cc ('k') | ui/views/controls/button/checkbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698