Home | History | Annotate | Download | only in status_icons
      1 // Copyright (c) 2012 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_tray.h"
      6 
      7 #include <algorithm>
      8 
      9 #include "chrome/browser/status_icons/status_icon.h"
     10 
     11 StatusTray::~StatusTray() {
     12 }
     13 
     14 StatusIcon* StatusTray::CreateStatusIcon(StatusIconType type,
     15                                          const gfx::ImageSkia& image,
     16                                          const base::string16& tool_tip) {
     17   StatusIcon* icon = CreatePlatformStatusIcon(type, image, tool_tip);
     18   if (icon)
     19     status_icons_.push_back(icon);
     20   return icon;
     21 }
     22 
     23 void StatusTray::RemoveStatusIcon(StatusIcon* icon) {
     24   StatusIcons::iterator i(
     25       std::find(status_icons_.begin(), status_icons_.end(), icon));
     26 
     27   if (i == status_icons_.end()) {
     28     NOTREACHED();
     29     return;
     30   }
     31 
     32   status_icons_.erase(i);
     33 }
     34 
     35 StatusTray::StatusTray() {
     36 }
     37