• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2010 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 #include "chrome/browser/status_icons/status_icon.h"
6 
7 #include "ui/base/models/menu_model.h"
8 
StatusIcon()9 StatusIcon::StatusIcon()
10 {
11 }
12 
~StatusIcon()13 StatusIcon::~StatusIcon() {
14 }
15 
AddObserver(Observer * observer)16 void StatusIcon::AddObserver(Observer* observer) {
17   observers_.AddObserver(observer);
18 }
19 
RemoveObserver(Observer * observer)20 void StatusIcon::RemoveObserver(Observer* observer) {
21   observers_.RemoveObserver(observer);
22 }
23 
HasObservers()24 bool StatusIcon::HasObservers() {
25   return observers_.size() > 0;
26 }
27 
DispatchClickEvent()28 void StatusIcon::DispatchClickEvent() {
29   FOR_EACH_OBSERVER(Observer, observers_, OnClicked());
30 }
31 
SetContextMenu(ui::MenuModel * menu)32 void StatusIcon::SetContextMenu(ui::MenuModel* menu) {
33   context_menu_contents_.reset(menu);
34   UpdatePlatformContextMenu(menu);
35 }
36