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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 99543003: Fix popup crash on ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + WS nit. Created 7 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/web_notification/web_notification_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/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_layout_manager_observer.h" 10 #include "ash/shelf/shelf_layout_manager_observer.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 internal::kShellWindowId_StatusContainer), 409 internal::kShellWindowId_StatusContainer),
410 message_center(), 410 message_center(),
411 message_center_tray_.get(), 411 message_center_tray_.get(),
412 ash::switches::UseAlternateShelfLayout())); 412 ash::switches::UseAlternateShelfLayout()));
413 work_area_observer_->StartObserving( 413 work_area_observer_->StartObserving(
414 popup_collection_.get(), GetWidget()->GetNativeView()->GetRootWindow()); 414 popup_collection_.get(), GetWidget()->GetNativeView()->GetRootWindow());
415 return true; 415 return true;
416 } 416 }
417 417
418 void WebNotificationTray::HidePopups() { 418 void WebNotificationTray::HidePopups() {
419 DCHECK(popup_collection_.get());
420
421 popup_collection_->MarkAllPopupsShown();
419 popup_collection_.reset(); 422 popup_collection_.reset();
420 work_area_observer_->StopObserving(); 423 work_area_observer_->StopObserving();
421 } 424 }
422 425
423 // Private methods. 426 // Private methods.
424 427
425 bool WebNotificationTray::ShouldShowMessageCenter() { 428 bool WebNotificationTray::ShouldShowMessageCenter() {
426 return status_area_widget()->login_status() != user::LOGGED_IN_LOCKED && 429 return status_area_widget()->login_status() != user::LOGGED_IN_LOCKED &&
427 !(status_area_widget()->system_tray() && 430 !(status_area_widget()->system_tray() &&
428 status_area_widget()->system_tray()->HasNotificationBubble()); 431 status_area_widget()->system_tray()->HasNotificationBubble());
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 615
613 message_center::MessageCenterBubble* 616 message_center::MessageCenterBubble*
614 WebNotificationTray::GetMessageCenterBubbleForTest() { 617 WebNotificationTray::GetMessageCenterBubbleForTest() {
615 if (!message_center_bubble()) 618 if (!message_center_bubble())
616 return NULL; 619 return NULL;
617 return static_cast<message_center::MessageCenterBubble*>( 620 return static_cast<message_center::MessageCenterBubble*>(
618 message_center_bubble()->bubble()); 621 message_center_bubble()->bubble());
619 } 622 }
620 623
621 } // namespace ash 624 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/web_notification/web_notification_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698