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 #include "base/macros.h" 12 13 namespace content { 14 struct ContextMenuParams; 15 } 16 17 class AlloyBrowserHostImpl; 18 class CefMenuModelImpl; 19 20 // Provides platform-specific menu implementations for CefMenuCreator. 21 class CefMenuRunner { 22 public: 23 virtual bool RunContextMenu(AlloyBrowserHostImpl* browser, 24 CefMenuModelImpl* model, 25 const content::ContextMenuParams& params) = 0; CancelContextMenu()26 virtual void CancelContextMenu() {} FormatLabel(std::u16string & label)27 virtual bool FormatLabel(std::u16string& label) { return false; } 28 29 protected: 30 // Allow deletion via scoped_ptr only. 31 friend std::default_delete<CefMenuRunner>; 32 CefMenuRunner()33 CefMenuRunner() {} ~CefMenuRunner()34 virtual ~CefMenuRunner() {} 35 36 DISALLOW_COPY_AND_ASSIGN(CefMenuRunner); 37 }; 38 39 #endif // CEF_LIBCEF_BROWSER_MENU_RUNNER_H_ 40