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

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

Issue 2816193002: Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: tdanderson review + rebase Created 3 years, 8 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
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 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 void View::PropagateNativeThemeChanged(const ui::NativeTheme* theme) { 2107 void View::PropagateNativeThemeChanged(const ui::NativeTheme* theme) {
2108 if (native_theme_ && native_theme_ != theme) 2108 if (native_theme_ && native_theme_ != theme)
2109 return; 2109 return;
2110 2110
2111 { 2111 {
2112 internal::ScopedChildrenLock lock(this); 2112 internal::ScopedChildrenLock lock(this);
2113 for (auto* child : children_) 2113 for (auto* child : children_)
2114 child->PropagateNativeThemeChanged(theme); 2114 child->PropagateNativeThemeChanged(theme);
2115 } 2115 }
2116 OnNativeThemeChanged(theme); 2116 OnNativeThemeChanged(theme);
2117 for (ViewObserver& observer : observers_)
2118 observer.OnViewNativeThemeChanged(this);
2117 } 2119 }
2118 2120
2119 // Size and disposition -------------------------------------------------------- 2121 // Size and disposition --------------------------------------------------------
2120 2122
2121 void View::PropagateVisibilityNotifications(View* start, bool is_visible) { 2123 void View::PropagateVisibilityNotifications(View* start, bool is_visible) {
2122 { 2124 {
2123 internal::ScopedChildrenLock lock(this); 2125 internal::ScopedChildrenLock lock(this);
2124 for (auto* child : children_) 2126 for (auto* child : children_)
2125 child->PropagateVisibilityNotifications(start, is_visible); 2127 child->PropagateVisibilityNotifications(start, is_visible);
2126 } 2128 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 // Message the RootView to do the drag and drop. That way if we're removed 2642 // Message the RootView to do the drag and drop. That way if we're removed
2641 // the RootView can detect it and avoid calling us back. 2643 // the RootView can detect it and avoid calling us back.
2642 gfx::Point widget_location(event.location()); 2644 gfx::Point widget_location(event.location());
2643 ConvertPointToWidget(this, &widget_location); 2645 ConvertPointToWidget(this, &widget_location);
2644 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2646 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2645 // WARNING: we may have been deleted. 2647 // WARNING: we may have been deleted.
2646 return true; 2648 return true;
2647 } 2649 }
2648 2650
2649 } // namespace views 2651 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698