| 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 void View::SetBorder(std::unique_ptr<Border> b) { | 867 void View::SetBorder(std::unique_ptr<Border> b) { |
| 868 border_ = std::move(b); | 868 border_ = std::move(b); |
| 869 } | 869 } |
| 870 | 870 |
| 871 const ui::ThemeProvider* View::GetThemeProvider() const { | 871 const ui::ThemeProvider* View::GetThemeProvider() const { |
| 872 const Widget* widget = GetWidget(); | 872 const Widget* widget = GetWidget(); |
| 873 return widget ? widget->GetThemeProvider() : nullptr; | 873 return widget ? widget->GetThemeProvider() : nullptr; |
| 874 } | 874 } |
| 875 | 875 |
| 876 const ui::NativeTheme* View::GetNativeTheme() const { | 876 const ui::NativeTheme* View::GetNativeTheme() const { |
| 877 if (parent()) |
| 878 return parent()->GetNativeTheme(); |
| 879 |
| 877 const Widget* widget = GetWidget(); | 880 const Widget* widget = GetWidget(); |
| 878 if (widget) | 881 if (widget) |
| 879 return widget->GetNativeTheme(); | 882 return widget->GetNativeTheme(); |
| 880 | 883 |
| 881 #if defined(OS_WIN) | 884 #if defined(OS_WIN) |
| 882 // On Windows, ui::NativeTheme::GetInstanceForWeb() returns NativeThemeWinAura | 885 // On Windows, ui::NativeTheme::GetInstanceForWeb() returns NativeThemeWinAura |
| 883 // because that's what the renderer wants, but Views should default to | 886 // because that's what the renderer wants, but Views should default to |
| 884 // NativeThemeWin. TODO(estade): clean this up, see http://crbug.com/558029 | 887 // NativeThemeWin. TODO(estade): clean this up, see http://crbug.com/558029 |
| 885 return ui::NativeThemeWin::instance(); | 888 return ui::NativeThemeWin::instance(); |
| 886 #else | 889 #else |
| (...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2426 // Message the RootView to do the drag and drop. That way if we're removed | 2429 // Message the RootView to do the drag and drop. That way if we're removed |
| 2427 // the RootView can detect it and avoid calling us back. | 2430 // the RootView can detect it and avoid calling us back. |
| 2428 gfx::Point widget_location(event.location()); | 2431 gfx::Point widget_location(event.location()); |
| 2429 ConvertPointToWidget(this, &widget_location); | 2432 ConvertPointToWidget(this, &widget_location); |
| 2430 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2433 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2431 // WARNING: we may have been deleted. | 2434 // WARNING: we may have been deleted. |
| 2432 return true; | 2435 return true; |
| 2433 } | 2436 } |
| 2434 | 2437 |
| 2435 } // namespace views | 2438 } // namespace views |
| OLD | NEW |