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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « ui/views/test/combobox_test_api.cc ('k') | ui/wm/core/focus_controller_unittest.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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 1090
1091 bool View::CanAcceptEvent(const ui::Event& event) { 1091 bool View::CanAcceptEvent(const ui::Event& event) {
1092 return IsDrawn(); 1092 return IsDrawn();
1093 } 1093 }
1094 1094
1095 ui::EventTarget* View::GetParentTarget() { 1095 ui::EventTarget* View::GetParentTarget() {
1096 return parent_; 1096 return parent_;
1097 } 1097 }
1098 1098
1099 std::unique_ptr<ui::EventTargetIterator> View::GetChildIterator() const { 1099 std::unique_ptr<ui::EventTargetIterator> View::GetChildIterator() const {
1100 return base::WrapUnique(new ui::EventTargetIteratorImpl<View>(children_)); 1100 return base::MakeUnique<ui::EventTargetIteratorImpl<View>>(children_);
1101 } 1101 }
1102 1102
1103 ui::EventTargeter* View::GetEventTargeter() { 1103 ui::EventTargeter* View::GetEventTargeter() {
1104 return targeter_.get(); 1104 return targeter_.get();
1105 } 1105 }
1106 1106
1107 void View::ConvertEventToTarget(ui::EventTarget* target, 1107 void View::ConvertEventToTarget(ui::EventTarget* target,
1108 ui::LocatedEvent* event) { 1108 ui::LocatedEvent* event) {
1109 event->ConvertLocationToTarget(this, static_cast<View*>(target)); 1109 event->ConvertLocationToTarget(this, static_cast<View*>(target));
1110 } 1110 }
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2426 // Message the RootView to do the drag and drop. That way if we're removed 2426 // 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. 2427 // the RootView can detect it and avoid calling us back.
2428 gfx::Point widget_location(event.location()); 2428 gfx::Point widget_location(event.location());
2429 ConvertPointToWidget(this, &widget_location); 2429 ConvertPointToWidget(this, &widget_location);
2430 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2430 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2431 // WARNING: we may have been deleted. 2431 // WARNING: we may have been deleted.
2432 return true; 2432 return true;
2433 } 2433 }
2434 2434
2435 } // namespace views 2435 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/combobox_test_api.cc ('k') | ui/wm/core/focus_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698