Chromium Code Reviews| 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 #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 Loading... | |
| 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 command specified by |command_id| is present |
|
Peter Kasting
2015/06/15 23:45:15
Nit: While here: if command -> if the command
Peter Kasting
2015/06/16 08:20:24
This is still outstanding.
jochen (gone - plz use gerrit)
2015/06/16 09:01:50
oops, done
| |
| 45 // in the menu. | 45 // in the menu. |
| 46 // List of command ids can be found in chrome/app/chrome_command_ids.h. | 46 // List of command ids can be found in chrome/app/chrome_command_ids.h. |
|
Peter Kasting
2015/06/15 23:45:15
Nit: While here: List -> A list
jochen (gone - plz use gerrit)
2015/06/16 08:00:14
done
| |
| 47 bool IsItemPresent(int command_id); | 47 bool IsItemPresent(int command_id); |
| 48 | 48 |
| 49 // Returns true if command specified by any command id between | |
|
Peter Kasting
2015/06/15 23:45:15
Nit: command -> a command
jochen (gone - plz use gerrit)
2015/06/16 08:00:14
done
| |
| 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_ |
| OLD | NEW |