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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 9583001: ash uber tray: Fix a couple of crashes when quitting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include "ash/shell/panel_window.h" 7 #include "ash/shell/panel_window.h"
8 #include "ash/system/tray/system_tray_item.h" 8 #include "ash/system/tray/system_tray_item.h"
9 #include "ash/wm/shadow_types.h" 9 #include "ash/wm/shadow_types.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 namespace ash { 74 namespace ash {
75 75
76 SystemTray::SystemTray() 76 SystemTray::SystemTray()
77 : items_(), 77 : items_(),
78 popup_(NULL) { 78 popup_(NULL) {
79 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 79 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
80 5, 10, 3)); 80 5, 10, 3));
81 } 81 }
82 82
83 SystemTray::~SystemTray() { 83 SystemTray::~SystemTray() {
84 if (popup_)
85 popup_->CloseNow();
84 for (std::vector<SystemTrayItem*>::iterator it = items_.begin(); 86 for (std::vector<SystemTrayItem*>::iterator it = items_.begin();
85 it != items_.end(); 87 it != items_.end();
86 ++it) { 88 ++it) {
87 (*it)->DestroyTrayView(); 89 (*it)->DestroyTrayView();
88 } 90 }
89 } 91 }
90 92
91 void SystemTray::AddTrayItem(SystemTrayItem* item) { 93 void SystemTray::AddTrayItem(SystemTrayItem* item) {
92 items_.push_back(item); 94 items_.push_back(item);
93 95
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 ShowItems(items_, false); 129 ShowItems(items_, false);
128 return true; 130 return true;
129 } 131 }
130 132
131 void SystemTray::OnWidgetClosing(views::Widget* widget) { 133 void SystemTray::OnWidgetClosing(views::Widget* widget) {
132 CHECK_EQ(popup_, widget); 134 CHECK_EQ(popup_, widget);
133 popup_ = NULL; 135 popup_ = NULL;
134 } 136 }
135 137
136 } // namespace ash 138 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698