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

Side by Side Diff: ui/linux_ui/status_icon_linux.h

Issue 18334003: Linux status icon for Ubuntu Unity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: file restored Created 7 years, 5 months 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
(Empty)
1 // Copyright (c) 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.
4
5 #ifndef UI_LINUX_UI_STATUS_ICON_LINUX_H_
6 #define UI_LINUX_UI_STATUS_ICON_LINUX_H_
7
8 #include "base/strings/string16.h"
9
10 namespace gfx {
11 class ImageSkia;
12 }
13
14 namespace ui {
15 class MenuModel;
16 } // namespace ui
17
18 // Since liblinux_ui cannot have dependencies on any chrome browser components
19 // we cannot inherit from StatusIcon. So we implement the necessary methods
20 // and let a wrapper class implement the StatusIcon interface and defer the
21 // callbacks to a delegate.
22 class StatusIconLinux {
23 public:
24 class Delegate {
25 public:
26 virtual void OnClick() = 0;
27
28 protected:
29 virtual ~Delegate();
30 };
31
32 StatusIconLinux();
33 virtual ~StatusIconLinux();
34
35 virtual void SetImage(const gfx::ImageSkia& image) = 0;
36 virtual void SetPressedImage(const gfx::ImageSkia& image) = 0;
37 virtual void SetToolTip(const string16& tool_tip) = 0;
38 virtual void SetClickActionLabel(const string16& label) = 0;
39
40 // Invoked after a call to SetContextMenu() to let the platform-specific
41 // subclass update the native context menu based on the new model. The
42 // subclass should destroy the existing native context menu on this call.
43 virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0;
44
45 Delegate* delegate() { return delegate_; }
46 void set_delegate(Delegate* delegate) { delegate_ = delegate; }
47
48 private:
49 Delegate* delegate_;
50 };
51
52 #endif // UI_LINUX_UI_STATUS_ICON_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698