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

Side by Side Diff: ui/views/view.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.h ('k') | ui/views/window/dialog_delegate.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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 canvas->Translate(GetMirroredPosition().OffsetFromOrigin()); 797 canvas->Translate(GetMirroredPosition().OffsetFromOrigin());
798 canvas->Transform(GetTransform()); 798 canvas->Transform(GetTransform());
799 799
800 PaintCommon(canvas); 800 PaintCommon(canvas);
801 } 801 }
802 802
803 void View::set_background(Background* b) { 803 void View::set_background(Background* b) {
804 background_.reset(b); 804 background_.reset(b);
805 } 805 }
806 806
807 void View::set_border(Border* b) { 807 void View::SetBorder(scoped_ptr<Border> b) { border_ = b.Pass(); }
808 border_.reset(b);
809 }
810 808
811 ui::ThemeProvider* View::GetThemeProvider() const { 809 ui::ThemeProvider* View::GetThemeProvider() const {
812 const Widget* widget = GetWidget(); 810 const Widget* widget = GetWidget();
813 return widget ? widget->GetThemeProvider() : NULL; 811 return widget ? widget->GetThemeProvider() : NULL;
814 } 812 }
815 813
816 const ui::NativeTheme* View::GetNativeTheme() const { 814 const ui::NativeTheme* View::GetNativeTheme() const {
817 const Widget* widget = GetWidget(); 815 const Widget* widget = GetWidget();
818 return widget ? widget->GetNativeTheme() : ui::NativeTheme::instance(); 816 return widget ? widget->GetNativeTheme() : ui::NativeTheme::instance();
819 } 817 }
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2387 // Message the RootView to do the drag and drop. That way if we're removed 2385 // Message the RootView to do the drag and drop. That way if we're removed
2388 // the RootView can detect it and avoid calling us back. 2386 // the RootView can detect it and avoid calling us back.
2389 gfx::Point widget_location(event.location()); 2387 gfx::Point widget_location(event.location());
2390 ConvertPointToWidget(this, &widget_location); 2388 ConvertPointToWidget(this, &widget_location);
2391 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2389 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2392 // WARNING: we may have been deleted. 2390 // WARNING: we may have been deleted.
2393 return true; 2391 return true;
2394 } 2392 }
2395 2393
2396 } // namespace views 2394 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698