OLD | NEW |
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 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 runner_->Cancel(); | 131 runner_->Cancel(); |
132 EXPECT_FALSE(runner_->IsRunning()); | 132 EXPECT_FALSE(runner_->IsRunning()); |
133 } | 133 } |
134 | 134 |
135 void MenuDeleteCallback() { | 135 void MenuDeleteCallback() { |
136 runner_->Release(); | 136 runner_->Release(); |
137 runner_ = nullptr; | 137 runner_ = nullptr; |
138 } | 138 } |
139 | 139 |
140 protected: | 140 protected: |
141 scoped_ptr<TestModel> menu_; | 141 std::unique_ptr<TestModel> menu_; |
142 internal::MenuRunnerImplCocoa* runner_ = nullptr; | 142 internal::MenuRunnerImplCocoa* runner_ = nullptr; |
143 views::Widget* parent_ = nullptr; | 143 views::Widget* parent_ = nullptr; |
144 NSRect last_anchor_frame_ = NSZeroRect; | 144 NSRect last_anchor_frame_ = NSZeroRect; |
145 | 145 |
146 private: | 146 private: |
147 void RunMenuWrapperCallback(const base::Closure& callback) { | 147 void RunMenuWrapperCallback(const base::Closure& callback) { |
148 EXPECT_TRUE(runner_->IsRunning()); | 148 EXPECT_TRUE(runner_->IsRunning()); |
149 callback.Run(); | 149 callback.Run(); |
150 } | 150 } |
151 | 151 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // In RTL, Cocoa messes up the positioning unless the anchor rectangle is | 239 // In RTL, Cocoa messes up the positioning unless the anchor rectangle is |
240 // offset to the right of the view. The offset for the checkmark is also | 240 // offset to the right of the view. The offset for the checkmark is also |
241 // skipped, to give a better match to native behavior. | 241 // skipped, to give a better match to native behavior. |
242 base::i18n::SetICUDefaultLocale("he"); | 242 base::i18n::SetICUDefaultLocale("he"); |
243 RunMenuAt(anchor_rect); | 243 RunMenuAt(anchor_rect); |
244 EXPECT_EQ(combobox_rect.right(), last_anchor_frame_.origin.x); | 244 EXPECT_EQ(combobox_rect.right(), last_anchor_frame_.origin.x); |
245 } | 245 } |
246 | 246 |
247 } // namespace test | 247 } // namespace test |
248 } // namespace views | 248 } // namespace views |
OLD | NEW |