| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |