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

Side by Side Diff: ui/views/controls/menu/menu_runner_impl_cocoa.mm

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ui/views/controls/menu/menu_runner_impl_cocoa.h" 5 #import "ui/views/controls/menu/menu_runner_impl_cocoa.h"
6 6
7 #include "base/mac/sdk_forward_declarations.h" 7 #include "base/mac/sdk_forward_declarations.h"
8 #import "ui/base/cocoa/menu_controller.h" 8 #import "ui/base/cocoa/menu_controller.h"
9 #include "ui/base/models/menu_model.h" 9 #include "ui/base/models/menu_model.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 NSMenu* menu = [menu_controller_ menu]; 138 NSMenu* menu = [menu_controller_ menu];
139 [menu setMinimumWidth:bounds.width() + kNativeCheckmarkWidth]; 139 [menu setMinimumWidth:bounds.width() + kNativeCheckmarkWidth];
140 [menu popUpMenuPositioningItem:checked_item 140 [menu popUpMenuPositioningItem:checked_item
141 atLocation:NSZeroPoint 141 atLocation:NSZeroPoint
142 inView:anchor_view]; 142 inView:anchor_view];
143 [anchor_view removeFromSuperview]; 143 [anchor_view removeFromSuperview];
144 } else { 144 } else {
145 NOTREACHED(); 145 NOTREACHED();
146 } 146 }
147 147
148 closing_event_time_ = ui::EventTimeForNow(); 148 closing_event_time_ = (base::TimeTicks::Now() - base::TimeTicks());
149 running_ = false; 149 running_ = false;
150 150
151 if (delete_after_run_) { 151 if (delete_after_run_) {
152 delete this; 152 delete this;
153 return MenuRunner::MENU_DELETED; 153 return MenuRunner::MENU_DELETED;
154 } 154 }
155 155
156 return MenuRunner::NORMAL_EXIT; 156 return MenuRunner::NORMAL_EXIT;
157 } 157 }
158 158
159 void MenuRunnerImplCocoa::Cancel() { 159 void MenuRunnerImplCocoa::Cancel() {
160 [menu_controller_ cancel]; 160 [menu_controller_ cancel];
161 } 161 }
162 162
163 base::TimeDelta MenuRunnerImplCocoa::GetClosingEventTime() const { 163 base::TimeDelta MenuRunnerImplCocoa::GetClosingEventTime() const {
164 return closing_event_time_; 164 return closing_event_time_;
165 } 165 }
166 166
167 MenuRunnerImplCocoa::~MenuRunnerImplCocoa() { 167 MenuRunnerImplCocoa::~MenuRunnerImplCocoa() {
168 } 168 }
169 169
170 } // namespace internal 170 } // namespace internal
171 } // namespace views 171 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_runner_cocoa_unittest.mm ('k') | ui/views/controls/table/table_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698