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

Side by Side Diff: ui/base/cocoa/menu_controller_unittest.mm

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. 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/app_list/app_list_menu.cc ('k') | ui/base/models/button_menu_item_model.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 27 matching lines...) Expand all
38 menu_to_close_(nil), 38 menu_to_close_(nil),
39 did_show_(false), 39 did_show_(false),
40 did_close_(false) { 40 did_close_(false) {
41 } 41 }
42 42
43 bool IsCommandIdChecked(int command_id) const override { return false; } 43 bool IsCommandIdChecked(int command_id) const override { return false; }
44 bool IsCommandIdEnabled(int command_id) const override { 44 bool IsCommandIdEnabled(int command_id) const override {
45 ++enable_count_; 45 ++enable_count_;
46 return true; 46 return true;
47 } 47 }
48 bool GetAcceleratorForCommandId(int command_id,
49 Accelerator* accelerator) const override {
50 return false;
51 }
52 void ExecuteCommand(int command_id, int event_flags) override { 48 void ExecuteCommand(int command_id, int event_flags) override {
53 ++execute_count_; 49 ++execute_count_;
54 } 50 }
55 51
56 void MenuWillShow(SimpleMenuModel* /*source*/) override { 52 void MenuWillShow(SimpleMenuModel* /*source*/) override {
57 EXPECT_FALSE(did_show_); 53 EXPECT_FALSE(did_show_);
58 EXPECT_FALSE(did_close_); 54 EXPECT_FALSE(did_close_);
59 did_show_ = true; 55 did_show_ = true;
60 NSArray* modes = [NSArray arrayWithObjects:NSEventTrackingRunLoopMode, 56 NSArray* modes = [NSArray arrayWithObjects:NSEventTrackingRunLoopMode,
61 NSDefaultRunLoopMode, 57 NSDefaultRunLoopMode,
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // Pump the task that notifies the delegate. 388 // Pump the task that notifies the delegate.
393 message_loop.RunUntilIdle(); 389 message_loop.RunUntilIdle();
394 390
395 // Expect that the delegate got notified properly. 391 // Expect that the delegate got notified properly.
396 EXPECT_TRUE(delegate.did_close_); 392 EXPECT_TRUE(delegate.did_close_);
397 } 393 }
398 394
399 } // namespace 395 } // namespace
400 396
401 } // namespace ui 397 } // namespace ui
OLDNEW
« no previous file with comments | « ui/app_list/app_list_menu.cc ('k') | ui/base/models/button_menu_item_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698