OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/accessibility/accessibility_extension_api.h" | 10 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 439 |
440 views::MenuItemView* BuildMenu() { | 440 views::MenuItemView* BuildMenu() { |
441 menu_model_.reset(new ui::SimpleMenuModel(this)); | 441 menu_model_.reset(new ui::SimpleMenuModel(this)); |
442 menu_model_->AddItem(IDC_MENU_ITEM_1, ASCIIToUTF16("Item 1")); | 442 menu_model_->AddItem(IDC_MENU_ITEM_1, ASCIIToUTF16("Item 1")); |
443 menu_model_->AddItem(IDC_MENU_ITEM_2, ASCIIToUTF16("Item 2")); | 443 menu_model_->AddItem(IDC_MENU_ITEM_2, ASCIIToUTF16("Item 2")); |
444 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); | 444 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); |
445 menu_model_->AddItem(IDC_MENU_INVISIBLE, ASCIIToUTF16("Invisible")); | 445 menu_model_->AddItem(IDC_MENU_INVISIBLE, ASCIIToUTF16("Invisible")); |
446 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); | 446 menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); |
447 menu_model_->AddItem(IDC_MENU_ITEM_3, ASCIIToUTF16("Item 3")); | 447 menu_model_->AddItem(IDC_MENU_ITEM_3, ASCIIToUTF16("Item 3")); |
448 | 448 |
449 menu_runner_.reset(new views::MenuRunner(menu_model_.get())); | 449 menu_runner_.reset(new views::MenuRunner(menu_model_.get(), 0)); |
450 return menu_runner_->GetMenu(); | 450 return menu_runner_->GetMenu(); |
451 } | 451 } |
452 | 452 |
453 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE { | 453 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE { |
454 return false; | 454 return false; |
455 } | 455 } |
456 | 456 |
457 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE { | 457 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE { |
458 return true; | 458 return true; |
459 } | 459 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 502 |
503 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( | 503 AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( |
504 menu_container, | 504 menu_container, |
505 menu->GetMenuItemByID(kTestCases[i].command_id), | 505 menu->GetMenuItemByID(kTestCases[i].command_id), |
506 &index, | 506 &index, |
507 &count); | 507 &count); |
508 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; | 508 EXPECT_EQ(kTestCases[i].expected_index, index) << "Case " << i; |
509 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; | 509 EXPECT_EQ(kTestCases[i].expected_count, count) << "Case " << i; |
510 } | 510 } |
511 } | 511 } |
OLD | NEW |