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

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

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: wip: address high-level comments Created 3 years, 9 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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 2031
2032 void View::PropagateNativeThemeChanged(const ui::NativeTheme* theme) { 2032 void View::PropagateNativeThemeChanged(const ui::NativeTheme* theme) {
2033 if (native_theme_ && native_theme_ != theme) 2033 if (native_theme_ && native_theme_ != theme)
2034 return; 2034 return;
2035 2035
2036 { 2036 {
2037 internal::ScopedChildrenLock lock(this); 2037 internal::ScopedChildrenLock lock(this);
2038 for (auto* child : children_) 2038 for (auto* child : children_)
2039 child->PropagateNativeThemeChanged(theme); 2039 child->PropagateNativeThemeChanged(theme);
2040 } 2040 }
2041 for (ViewObserver& observer : observers_)
2042 observer.OnNativeThemeChanged(this, theme);
2041 OnNativeThemeChanged(theme); 2043 OnNativeThemeChanged(theme);
2042 } 2044 }
2043 2045
2044 // Size and disposition -------------------------------------------------------- 2046 // Size and disposition --------------------------------------------------------
2045 2047
2046 void View::PropagateVisibilityNotifications(View* start, bool is_visible) { 2048 void View::PropagateVisibilityNotifications(View* start, bool is_visible) {
2047 { 2049 {
2048 internal::ScopedChildrenLock lock(this); 2050 internal::ScopedChildrenLock lock(this);
2049 for (auto* child : children_) 2051 for (auto* child : children_)
2050 child->PropagateVisibilityNotifications(start, is_visible); 2052 child->PropagateVisibilityNotifications(start, is_visible);
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 } 2499 }
2498 2500
2499 // System events --------------------------------------------------------------- 2501 // System events ---------------------------------------------------------------
2500 2502
2501 void View::PropagateThemeChanged() { 2503 void View::PropagateThemeChanged() {
2502 { 2504 {
2503 internal::ScopedChildrenLock lock(this); 2505 internal::ScopedChildrenLock lock(this);
2504 for (auto* child : base::Reversed(children_)) 2506 for (auto* child : base::Reversed(children_))
2505 child->PropagateThemeChanged(); 2507 child->PropagateThemeChanged();
2506 } 2508 }
2509 for (ViewObserver& observer : observers_)
2510 observer.OnThemeChanged(this);
2507 OnThemeChanged(); 2511 OnThemeChanged();
2508 } 2512 }
2509 2513
2510 void View::PropagateLocaleChanged() { 2514 void View::PropagateLocaleChanged() {
2511 { 2515 {
2512 internal::ScopedChildrenLock lock(this); 2516 internal::ScopedChildrenLock lock(this);
2513 for (auto* child : base::Reversed(children_)) 2517 for (auto* child : base::Reversed(children_))
2514 child->PropagateLocaleChanged(); 2518 child->PropagateLocaleChanged();
2515 } 2519 }
2516 OnLocaleChanged(); 2520 OnLocaleChanged();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 // Message the RootView to do the drag and drop. That way if we're removed 2569 // Message the RootView to do the drag and drop. That way if we're removed
2566 // the RootView can detect it and avoid calling us back. 2570 // the RootView can detect it and avoid calling us back.
2567 gfx::Point widget_location(event.location()); 2571 gfx::Point widget_location(event.location());
2568 ConvertPointToWidget(this, &widget_location); 2572 ConvertPointToWidget(this, &widget_location);
2569 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2573 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2570 // WARNING: we may have been deleted. 2574 // WARNING: we may have been deleted.
2571 return true; 2575 return true;
2572 } 2576 }
2573 2577
2574 } // namespace views 2578 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698