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

Side by Side Diff: chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc

Issue 892953002: Show icons for custom menuitems in contextmenu. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 #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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698