• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that can
3 // be found in the LICENSE file.
4 
5 #ifndef CEF_LIBCEF_BROWSER_MENU_RUNNER_H_
6 #define CEF_LIBCEF_BROWSER_MENU_RUNNER_H_
7 
8 #include <memory>
9 #include <string>
10 
11 namespace content {
12 struct ContextMenuParams;
13 }
14 
15 class AlloyBrowserHostImpl;
16 class CefMenuModelImpl;
17 
18 // Provides platform-specific menu implementations for CefMenuCreator.
19 class CefMenuRunner {
20  public:
21   CefMenuRunner(const CefMenuRunner&) = delete;
22   CefMenuRunner& operator=(const CefMenuRunner&) = delete;
23 
24   virtual bool RunContextMenu(AlloyBrowserHostImpl* browser,
25                               CefMenuModelImpl* model,
26                               const content::ContextMenuParams& params) = 0;
CancelContextMenu()27   virtual void CancelContextMenu() {}
FormatLabel(std::u16string & label)28   virtual bool FormatLabel(std::u16string& label) { return false; }
29 
30  protected:
31   // Allow deletion via std::unique_ptr only.
32   friend std::default_delete<CefMenuRunner>;
33 
34   CefMenuRunner() = default;
35   virtual ~CefMenuRunner() = default;
36 };
37 
38 #endif  // CEF_LIBCEF_BROWSER_MENU_RUNNER_H_
39