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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h

Issue 1191453002: Implement "open link as user" context menu entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 1 month 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 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_ H_ 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_ H_
6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_ H_ 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UTIL_ H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 9 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 23 matching lines...) Expand all
34 // Use the constructor if you want to create menu with fine-grained params. 34 // Use the constructor if you want to create menu with fine-grained params.
35 static TestRenderViewContextMenu* Create(content::WebContents* web_contents, 35 static TestRenderViewContextMenu* Create(content::WebContents* web_contents,
36 const GURL& page_url, 36 const GURL& page_url,
37 const GURL& link_url, 37 const GURL& link_url,
38 const GURL& frame_url); 38 const GURL& frame_url);
39 39
40 // Implementation of pure virtuals in RenderViewContextMenu. 40 // Implementation of pure virtuals in RenderViewContextMenu.
41 bool GetAcceleratorForCommandId(int command_id, 41 bool GetAcceleratorForCommandId(int command_id,
42 ui::Accelerator* accelerator) override; 42 ui::Accelerator* accelerator) override;
43 43
44 // Returns true if command specified by |command_id| is present 44 // Returns true if the command specified by |command_id| is present
45 // in the menu. 45 // in the menu.
46 // List of command ids can be found in chrome/app/chrome_command_ids.h. 46 // A list of command ids can be found in chrome/app/chrome_command_ids.h.
47 bool IsItemPresent(int command_id); 47 bool IsItemPresent(int command_id);
48 48
49 // Returns true if a command specified by any command id between
50 // |command_id_first| and |command_id_last| (inclusive) is present in the
51 // menu.
52 bool IsItemInRangePresent(int command_id_first, int command_id_last);
53
49 // Searches for an menu item with |command_id|. If it's found, the return 54 // Searches for an menu item with |command_id|. If it's found, the return
50 // value is true and the model and index where it appears in that model are 55 // value is true and the model and index where it appears in that model are
51 // returned in |found_model| and |found_index|. Otherwise returns false. 56 // returned in |found_model| and |found_index|. Otherwise returns false.
52 bool GetMenuModelAndItemIndex(int command_id, 57 bool GetMenuModelAndItemIndex(int command_id,
53 ui::MenuModel** found_model, 58 ui::MenuModel** found_model,
54 int* found_index); 59 int* found_index);
55 60
56 #if defined(ENABLE_EXTENSIONS) 61 #if defined(ENABLE_EXTENSIONS)
57 extensions::ContextMenuMatcher& extension_items() { return extension_items_; } 62 extensions::ContextMenuMatcher& extension_items() { return extension_items_; }
58 #endif 63 #endif
59 64
60 void Show() override; 65 void Show() override;
61 66
62 private: 67 private:
63 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu); 68 DISALLOW_COPY_AND_ASSIGN(TestRenderViewContextMenu);
64 }; 69 };
65 70
66 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UT IL_H_ 71 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_TEST_UT IL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698