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

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

Issue 11428100: Add NULL check in SystemTray::ShowDetailedView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a test. Created 8 years 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 | ash/system/tray/system_tray_unittest.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/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell/panel_window.h" 9 #include "ash/shell/panel_window.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 TrayBubbleView::InitParams::kArrowDefaultOffset); 231 TrayBubbleView::InitParams::kArrowDefaultOffset);
232 } 232 }
233 233
234 void SystemTray::ShowDetailedView(SystemTrayItem* item, 234 void SystemTray::ShowDetailedView(SystemTrayItem* item,
235 int close_delay, 235 int close_delay,
236 bool activate, 236 bool activate,
237 BubbleCreationType creation_type) { 237 BubbleCreationType creation_type) {
238 std::vector<SystemTrayItem*> items; 238 std::vector<SystemTrayItem*> items;
239 items.push_back(item); 239 items.push_back(item);
240 ShowItems(items, true, activate, creation_type, GetTrayXOffset(item)); 240 ShowItems(items, true, activate, creation_type, GetTrayXOffset(item));
241 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); 241 if (system_bubble_.get())
242 system_bubble_->bubble()->StartAutoCloseTimer(close_delay);
242 } 243 }
243 244
244 void SystemTray::SetDetailedViewCloseDelay(int close_delay) { 245 void SystemTray::SetDetailedViewCloseDelay(int close_delay) {
245 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED)) 246 if (HasSystemBubbleType(SystemTrayBubble::BUBBLE_TYPE_DETAILED))
246 system_bubble_->bubble()->StartAutoCloseTimer(close_delay); 247 system_bubble_->bubble()->StartAutoCloseTimer(close_delay);
247 } 248 }
248 249
249 void SystemTray::HideDetailedView(SystemTrayItem* item) { 250 void SystemTray::HideDetailedView(SystemTrayItem* item) {
250 if (item != detailed_item_) 251 if (item != detailed_item_)
251 return; 252 return;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 ConvertPointToWidget(this, &point); 583 ConvertPointToWidget(this, &point);
583 arrow_offset = point.x(); 584 arrow_offset = point.x();
584 } 585 }
585 } 586 }
586 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); 587 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset);
587 } 588 }
588 return true; 589 return true;
589 } 590 }
590 591
591 } // namespace ash 592 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/system_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698