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

Side by Side Diff: ui/aura/window.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/arc/notification/arc_notification_item.cc ('k') | ui/base/ime/input_method_factory.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 #include "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 ui::EventTarget* Window::GetParentTarget() { 1087 ui::EventTarget* Window::GetParentTarget() {
1088 if (IsRootWindow()) { 1088 if (IsRootWindow()) {
1089 return client::GetEventClient(this) ? 1089 return client::GetEventClient(this) ?
1090 client::GetEventClient(this)->GetToplevelEventTarget() : 1090 client::GetEventClient(this)->GetToplevelEventTarget() :
1091 Env::GetInstance(); 1091 Env::GetInstance();
1092 } 1092 }
1093 return parent_; 1093 return parent_;
1094 } 1094 }
1095 1095
1096 std::unique_ptr<ui::EventTargetIterator> Window::GetChildIterator() const { 1096 std::unique_ptr<ui::EventTargetIterator> Window::GetChildIterator() const {
1097 return base::WrapUnique(new ui::EventTargetIteratorImpl<Window>(children())); 1097 return base::MakeUnique<ui::EventTargetIteratorImpl<Window>>(children());
1098 } 1098 }
1099 1099
1100 ui::EventTargeter* Window::GetEventTargeter() { 1100 ui::EventTargeter* Window::GetEventTargeter() {
1101 return targeter_.get(); 1101 return targeter_.get();
1102 } 1102 }
1103 1103
1104 void Window::ConvertEventToTarget(ui::EventTarget* target, 1104 void Window::ConvertEventToTarget(ui::EventTarget* target,
1105 ui::LocatedEvent* event) { 1105 ui::LocatedEvent* event) {
1106 event->ConvertLocationToTarget(this, 1106 event->ConvertLocationToTarget(this,
1107 static_cast<Window*>(target)); 1107 static_cast<Window*>(target));
1108 } 1108 }
1109 1109
1110 void Window::UpdateLayerName() { 1110 void Window::UpdateLayerName() {
1111 #if !defined(NDEBUG) 1111 #if !defined(NDEBUG)
1112 DCHECK(layer()); 1112 DCHECK(layer());
1113 1113
1114 std::string layer_name(name_); 1114 std::string layer_name(name_);
1115 if (layer_name.empty()) 1115 if (layer_name.empty())
1116 layer_name = "Unnamed Window"; 1116 layer_name = "Unnamed Window";
1117 1117
1118 if (id_ != -1) 1118 if (id_ != -1)
1119 layer_name += " " + base::IntToString(id_); 1119 layer_name += " " + base::IntToString(id_);
1120 1120
1121 layer()->set_name(layer_name); 1121 layer()->set_name(layer_name);
1122 #endif 1122 #endif
1123 } 1123 }
1124 1124
1125 } // namespace aura 1125 } // namespace aura
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_notification_item.cc ('k') | ui/base/ime/input_method_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698