| OLD | NEW |
| 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.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 bubble_->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 341 bubble_->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 342 popup_->non_client_view()->frame_view()->set_background(NULL); | 342 popup_->non_client_view()->frame_view()->set_background(NULL); |
| 343 popup_->non_client_view()->frame_view()->set_border( | 343 popup_->non_client_view()->frame_view()->set_border( |
| 344 new SystemTrayBubbleBorder(bubble_)); | 344 new SystemTrayBubbleBorder(bubble_)); |
| 345 popup_->AddObserver(this); | 345 popup_->AddObserver(this); |
| 346 bubble_->Show(); | 346 bubble_->Show(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 bool SystemTray::OnMousePressed(const views::MouseEvent& event) { | 349 bool SystemTray::OnMousePressed(const views::MouseEvent& event) { |
| 350 if (popup_) | 350 if (popup_) |
| 351 popup_->Show(); | 351 popup_->Hide(); |
| 352 else | 352 else |
| 353 ShowItems(items_, false); | 353 ShowItems(items_, false); |
| 354 return true; | 354 return true; |
| 355 } | 355 } |
| 356 | 356 |
| 357 void SystemTray::OnMouseEntered(const views::MouseEvent& event) { | 357 void SystemTray::OnMouseEntered(const views::MouseEvent& event) { |
| 358 static_cast<SystemTrayBackground*>(background())->set_hovering(true); | 358 static_cast<SystemTrayBackground*>(background())->set_hovering(true); |
| 359 SchedulePaint(); | 359 SchedulePaint(); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void SystemTray::OnMouseExited(const views::MouseEvent& event) { | 362 void SystemTray::OnMouseExited(const views::MouseEvent& event) { |
| 363 static_cast<SystemTrayBackground*>(background())->set_hovering(false); | 363 static_cast<SystemTrayBackground*>(background())->set_hovering(false); |
| 364 SchedulePaint(); | 364 SchedulePaint(); |
| 365 } | 365 } |
| 366 | 366 |
| 367 void SystemTray::OnWidgetClosing(views::Widget* widget) { | 367 void SystemTray::OnWidgetClosing(views::Widget* widget) { |
| 368 CHECK_EQ(popup_, widget); | 368 CHECK_EQ(popup_, widget); |
| 369 popup_ = NULL; | 369 popup_ = NULL; |
| 370 bubble_ = NULL; | 370 bubble_ = NULL; |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace ash | 373 } // namespace ash |
| OLD | NEW |