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

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

Issue 10823350: Re-factor system tray code controlling launcher visibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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
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_bubble.h" 5 #include "ash/system/tray/system_tray_bubble.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "ash/system/tray/system_tray_delegate.h" 9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "ash/system/tray/system_tray_item.h" 10 #include "ash/system/tray/system_tray_item.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 InitializeAndShowBubble(bubble_widget_, bubble_view_, tray_); 313 InitializeAndShowBubble(bubble_widget_, bubble_view_, tray_);
314 } 314 }
315 315
316 void SystemTrayBubble::BubbleViewDestroyed() { 316 void SystemTrayBubble::BubbleViewDestroyed() {
317 DestroyItemViews(); 317 DestroyItemViews();
318 bubble_view_ = NULL; 318 bubble_view_ = NULL;
319 } 319 }
320 320
321 void SystemTrayBubble::OnMouseEnteredView() { 321 void SystemTrayBubble::OnMouseEnteredView() {
322 StopAutoCloseTimer(); 322 StopAutoCloseTimer();
323 tray_->UpdateShouldShowLauncher();
323 } 324 }
324 325
325 void SystemTrayBubble::OnMouseExitedView() { 326 void SystemTrayBubble::OnMouseExitedView() {
326 RestartAutoCloseTimer(); 327 RestartAutoCloseTimer();
328 tray_->UpdateShouldShowLauncher();
sadrul 2012/08/16 15:31:49 Can this hide the launcher immediately? Or after s
stevenjb 2012/08/16 16:59:04 Currently the launcher is hidden immediately, whic
327 } 329 }
328 330
329 void SystemTrayBubble::OnClickedOutsideView() { 331 void SystemTrayBubble::OnClickedOutsideView() {
330 if (bubble_type_ != BUBBLE_TYPE_NOTIFICATION) 332 if (bubble_type_ != BUBBLE_TYPE_NOTIFICATION)
331 bubble_widget_->Close(); 333 bubble_widget_->Close();
332 } 334 }
333 335
334 void SystemTrayBubble::DestroyItemViews() { 336 void SystemTrayBubble::DestroyItemViews() {
335 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin(); 337 for (std::vector<ash::SystemTrayItem*>::iterator it = items_.begin();
336 it != items_.end(); 338 it != items_.end();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 412 }
411 413
412 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) { 414 void SystemTrayBubble::OnWidgetClosing(views::Widget* widget) {
413 CHECK_EQ(bubble_widget_, widget); 415 CHECK_EQ(bubble_widget_, widget);
414 bubble_widget_ = NULL; 416 bubble_widget_ = NULL;
415 tray_->RemoveBubble(this); 417 tray_->RemoveBubble(this);
416 } 418 }
417 419
418 } // namespace internal 420 } // namespace internal
419 } // namespace ash 421 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698