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

Side by Side Diff: ui/message_center/cocoa/status_item_view.h

Issue 1334363002: [Eraser] First pass at removing the notification center panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: peter comments Created 5 years, 3 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_MESSAGE_CENTER_COCOA_STATUS_ITEM_VIEW_H_
6 #define UI_MESSAGE_CENTER_COCOA_STATUS_ITEM_VIEW_H_
7
8 #import <AppKit/AppKit.h>
9
10 #include "base/mac/scoped_block.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "ui/message_center/message_center_export.h"
13
14 namespace message_center {
15
16 // Callback block for when the status item is clicked.
17 typedef void(^StatusItemClickedCallback)();
18
19 } // namespace message_center
20
21 // This view is meant to be used with a NSStatusItem. It will fire a callback
22 // when it is clicked. It draws a small icon and the unread count, if greater
23 // than zero, to the icon's right. It can also paint the highlight background
24 // pattern outside of a mouse event sequence, for when an attached window is
25 // open.
26 MESSAGE_CENTER_EXPORT
27 @interface MCStatusItemView : NSView {
28 @private
29 // The status item.
30 base::scoped_nsobject<NSStatusItem> statusItem_;
31
32 // Callback issued when the status item is clicked.
33 base::mac::ScopedBlock<message_center::StatusItemClickedCallback> callback_;
34
35 // The unread count number to be drawn next to the icon.
36 size_t unreadCount_;
37
38 // Whether or not we are to display the quiet mode version of the status icon.
39 BOOL quietMode_;
40
41 // Whether or not to force the highlight pattern to be drawn.
42 BOOL highlight_;
43
44 // Whether or not the view is currently handling mouse events and should
45 // draw the highlight pattern.
46 BOOL inMouseEventSequence_;
47 }
48
49 @property(copy, nonatomic) message_center::StatusItemClickedCallback callback;
50 @property(nonatomic) BOOL highlight;
51
52 // Designated initializer. Creates a new NSStatusItem in the system menubar.
53 - (id)init;
54
55 // Sets the unread count and quiet mode status of the icon.
56 - (void)setUnreadCount:(size_t)unreadCount withQuietMode:(BOOL)quietMode;
57
58 // Removes the status item from the menubar. Must be called to break the
59 // retain cycle between self and the NSStatusItem view.
60 - (void)removeItem;
61
62 @end
63
64 @interface MCStatusItemView (TestingAPI)
65
66 - (size_t)unreadCount;
67
68 @end
69
70 #endif // UI_MESSAGE_CENTER_COCOA_STATUS_ITEM_VIEW_H_
OLDNEW
« no previous file with comments | « ui/message_center/cocoa/settings_entry_view.mm ('k') | ui/message_center/cocoa/status_item_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698