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 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" | 5 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void AddMenuItem(int command_id, const base::string16& title) override; | 49 void AddMenuItem(int command_id, const base::string16& title) override; |
50 void AddCheckItem(int command_id, const base::string16& title) override; | 50 void AddCheckItem(int command_id, const base::string16& title) override; |
51 void AddSeparator() override; | 51 void AddSeparator() override; |
52 void AddSubMenu(int command_id, | 52 void AddSubMenu(int command_id, |
53 const base::string16& label, | 53 const base::string16& label, |
54 ui::MenuModel* model) override; | 54 ui::MenuModel* model) override; |
55 void UpdateMenuItem(int command_id, | 55 void UpdateMenuItem(int command_id, |
56 bool enabled, | 56 bool enabled, |
57 bool hidden, | 57 bool hidden, |
58 const base::string16& title) override; | 58 const base::string16& title) override; |
| 59 void SetIcon(int command_id, const gfx::Image& icon) override {}; |
59 RenderViewHost* GetRenderViewHost() const override; | 60 RenderViewHost* GetRenderViewHost() const override; |
60 WebContents* GetWebContents() const override; | 61 WebContents* GetWebContents() const override; |
61 content::BrowserContext* GetBrowserContext() const override; | 62 content::BrowserContext* GetBrowserContext() const override; |
62 | 63 |
63 // Attaches a RenderViewContextMenuObserver to be tested. | 64 // Attaches a RenderViewContextMenuObserver to be tested. |
64 void SetObserver(RenderViewContextMenuObserver* observer); | 65 void SetObserver(RenderViewContextMenuObserver* observer); |
65 | 66 |
66 // Returns the number of items added by the test. | 67 // Returns the number of items added by the test. |
67 size_t GetMenuSize() const; | 68 size_t GetMenuSize() const; |
68 | 69 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 ForceSuggestMode(); | 469 ForceSuggestMode(); |
469 InitMenu("asdfkj", NULL); | 470 InitMenu("asdfkj", NULL); |
470 | 471 |
471 // Should have at least 2 entries. Separator, suggestion. | 472 // Should have at least 2 entries. Separator, suggestion. |
472 EXPECT_LT(2U, menu()->GetMenuSize()); | 473 EXPECT_LT(2U, menu()->GetMenuSize()); |
473 menu()->GetMenuItem(0, &item); | 474 menu()->GetMenuItem(0, &item); |
474 EXPECT_EQ(-1, item.command_id); | 475 EXPECT_EQ(-1, item.command_id); |
475 menu()->GetMenuItem(1, &item); | 476 menu()->GetMenuItem(1, &item); |
476 EXPECT_EQ(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, item.command_id); | 477 EXPECT_EQ(IDC_CONTENT_CONTEXT_SPELLING_SUGGESTION, item.command_id); |
477 } | 478 } |
OLD | NEW |