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

Side by Side Diff: ui/views/view.cc

Issue 1461923002: Change name of NativeTheme::instance() to make it clear it's web only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NATIVE_THEME_EXPORT for mac Created 5 years 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/views/view.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 const Widget* widget = GetWidget(); 833 const Widget* widget = GetWidget();
834 return widget ? widget->GetThemeProvider() : NULL; 834 return widget ? widget->GetThemeProvider() : NULL;
835 } 835 }
836 836
837 const ui::NativeTheme* View::GetNativeTheme() const { 837 const ui::NativeTheme* View::GetNativeTheme() const {
838 const Widget* widget = GetWidget(); 838 const Widget* widget = GetWidget();
839 if (widget) 839 if (widget)
840 return widget->GetNativeTheme(); 840 return widget->GetNativeTheme();
841 841
842 #if defined(OS_WIN) 842 #if defined(OS_WIN)
843 // On Windows, ui::NativeTheme::instance() returns NativeThemeWinAura because 843 // On Windows, ui::NativeTheme::GetInstanceForWeb() returns NativeThemeWinAura
844 // that's what the renderer wants, but Views should default to NativeThemeWin. 844 // because that's what the renderer wants, but Views should default to
845 // TODO(estade): clean this up, see http://crbug.com/558029 845 // NativeThemeWin. TODO(estade): clean this up, see http://crbug.com/558029
846 return ui::NativeThemeWin::instance(); 846 return ui::NativeThemeWin::instance();
847 #else 847 #else
848 return ui::NativeTheme::instance(); 848 return ui::NativeTheme::GetInstanceForWeb();
849 #endif 849 #endif
850 } 850 }
851 851
852 // RTL painting ---------------------------------------------------------------- 852 // RTL painting ----------------------------------------------------------------
853 853
854 void View::EnableCanvasFlippingForRTLUI(bool enable) { 854 void View::EnableCanvasFlippingForRTLUI(bool enable) {
855 flip_canvas_on_paint_for_rtl_ui_ = enable; 855 flip_canvas_on_paint_for_rtl_ui_ = enable;
856 } 856 }
857 857
858 // Input ----------------------------------------------------------------------- 858 // Input -----------------------------------------------------------------------
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 // Message the RootView to do the drag and drop. That way if we're removed 2365 // Message the RootView to do the drag and drop. That way if we're removed
2366 // the RootView can detect it and avoid calling us back. 2366 // the RootView can detect it and avoid calling us back.
2367 gfx::Point widget_location(event.location()); 2367 gfx::Point widget_location(event.location());
2368 ConvertPointToWidget(this, &widget_location); 2368 ConvertPointToWidget(this, &widget_location);
2369 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2369 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2370 // WARNING: we may have been deleted. 2370 // WARNING: we may have been deleted.
2371 return true; 2371 return true;
2372 } 2372 }
2373 2373
2374 } // namespace views 2374 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698