Make castv2 performance test work.
[chromium-blink-merge.git] / ui / views / linux_ui / status_icon_linux.h
blob569e948049167f22272a727602817d367ea29ff4
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_LINUX_UI_STATUS_ICON_LINUX_H_
6 #define UI_VIEWS_LINUX_UI_STATUS_ICON_LINUX_H_
8 #include "base/strings/string16.h"
9 #include "ui/views/views_export.h"
11 namespace gfx {
12 class ImageSkia;
15 namespace ui {
16 class MenuModel;
17 } // namespace ui
19 namespace views {
21 // Since liblinux_ui cannot have dependencies on any chrome browser components
22 // we cannot inherit from StatusIcon. So we implement the necessary methods
23 // and let a wrapper class implement the StatusIcon interface and defer the
24 // callbacks to a delegate. For the same reason, do not use StatusIconMenuModel.
25 class VIEWS_EXPORT StatusIconLinux {
26 public:
27 class Delegate {
28 public:
29 virtual void OnClick() = 0;
30 virtual bool HasClickAction() = 0;
32 protected:
33 virtual ~Delegate();
36 StatusIconLinux();
37 virtual ~StatusIconLinux();
39 virtual void SetImage(const gfx::ImageSkia& image) = 0;
40 virtual void SetToolTip(const base::string16& tool_tip) = 0;
42 // Invoked after a call to SetContextMenu() to let the platform-specific
43 // subclass update the native context menu based on the new model. The
44 // subclass should destroy the existing native context menu on this call.
45 virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0;
47 // Update all the enabled/checked states and the dynamic labels. Some status
48 // icon implementations do not refresh the native menu before showing so we
49 // need to manually refresh it when the menu model changes.
50 virtual void RefreshPlatformContextMenu();
52 Delegate* delegate() { return delegate_; }
53 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
55 private:
56 Delegate* delegate_;
59 } // namespace views
61 #endif // UI_LINUX_UI_STATUS_ICON_LINUX_H_