Chromium Code Reviews| Index: chrome/browser/status_icons/status_tray.cc |
| diff --git a/chrome/browser/status_icons/status_tray.cc b/chrome/browser/status_icons/status_tray.cc |
| index 2a72cd6f43b26fc17204abd117a3b0cbfc046f3f..9f5f4994b255a7949e9cee404f4f3a026696609a 100644 |
| --- a/chrome/browser/status_icons/status_tray.cc |
| +++ b/chrome/browser/status_icons/status_tray.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -13,10 +13,6 @@ StatusTray::StatusTray() { |
| } |
| StatusTray::~StatusTray() { |
| - RemoveAllIcons(); |
| -} |
| - |
| -void StatusTray::RemoveAllIcons() { |
| STLDeleteElements(&status_icons_); |
| } |
| @@ -28,11 +24,9 @@ StatusIcon* StatusTray::CreateStatusIcon() { |
| } |
| void StatusTray::RemoveStatusIcon(StatusIcon* icon) { |
| - StatusIconList::iterator iter = std::find( |
| - status_icons_.begin(), status_icons_.end(), icon); |
| - if (iter != status_icons_.end()) { |
| - // Free the StatusIcon from the list. |
| - delete *iter; |
| - status_icons_.erase(iter); |
| - } |
| + StatusIconList::iterator i(std::find(status_icons_.begin(), |
| + status_icons_.end(), icon)); |
| + DCHECK(i != status_icons_.end()); |
|
Andrew T Wilson (Slow)
2012/04/20 19:13:09
I think I'd prefer this to read:
if (i == status_i
tfarina
2012/04/20 19:24:13
Done.
|
| + delete *i; |
| + status_icons_.erase(i); |
| } |