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

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: one more 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 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 void View::PropagateNativeThemeChanged(const ui::NativeTheme* theme) { 2111 void View::PropagateNativeThemeChanged(const ui::NativeTheme* theme) {
2112 if (native_theme_ && native_theme_ != theme) 2112 if (native_theme_ && native_theme_ != theme)
2113 return; 2113 return;
2114 2114
2115 { 2115 {
2116 internal::ScopedChildrenLock lock(this); 2116 internal::ScopedChildrenLock lock(this);
2117 for (auto* child : children_) 2117 for (auto* child : children_)
2118 child->PropagateNativeThemeChanged(theme); 2118 child->PropagateNativeThemeChanged(theme);
2119 } 2119 }
2120 OnNativeThemeChanged(theme); 2120 OnNativeThemeChanged(theme);
2121 for (ViewObserver& observer : observers_)
2122 observer.OnViewNativeThemeChanged(this);
2121 } 2123 }
2122 2124
2123 // Size and disposition -------------------------------------------------------- 2125 // Size and disposition --------------------------------------------------------
2124 2126
2125 void View::PropagateVisibilityNotifications(View* start, bool is_visible) { 2127 void View::PropagateVisibilityNotifications(View* start, bool is_visible) {
2126 { 2128 {
2127 internal::ScopedChildrenLock lock(this); 2129 internal::ScopedChildrenLock lock(this);
2128 for (auto* child : children_) 2130 for (auto* child : children_)
2129 child->PropagateVisibilityNotifications(start, is_visible); 2131 child->PropagateVisibilityNotifications(start, is_visible);
2130 } 2132 }
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 // Message the RootView to do the drag and drop. That way if we're removed 2646 // Message the RootView to do the drag and drop. That way if we're removed
2645 // the RootView can detect it and avoid calling us back. 2647 // the RootView can detect it and avoid calling us back.
2646 gfx::Point widget_location(event.location()); 2648 gfx::Point widget_location(event.location());
2647 ConvertPointToWidget(this, &widget_location); 2649 ConvertPointToWidget(this, &widget_location);
2648 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2650 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2649 // WARNING: we may have been deleted. 2651 // WARNING: we may have been deleted.
2650 return true; 2652 return true;
2651 } 2653 }
2652 2654
2653 } // namespace views 2655 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698