| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 bool can_activate_; | 273 bool can_activate_; |
| 274 | 274 |
| 275 int autoclose_delay_; | 275 int autoclose_delay_; |
| 276 base::OneShotTimer<SystemTrayBubble> autoclose_; | 276 base::OneShotTimer<SystemTrayBubble> autoclose_; |
| 277 | 277 |
| 278 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); | 278 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); |
| 279 }; | 279 }; |
| 280 | 280 |
| 281 } // namespace internal | 281 } // namespace internal |
| 282 | 282 |
| 283 NetworkIconInfo::NetworkIconInfo() { |
| 284 } |
| 285 |
| 286 NetworkIconInfo::~NetworkIconInfo() { |
| 287 } |
| 288 |
| 283 SystemTray::SystemTray() | 289 SystemTray::SystemTray() |
| 284 : items_(), | 290 : items_(), |
| 285 bubble_(NULL), | 291 bubble_(NULL), |
| 286 popup_(NULL) { | 292 popup_(NULL) { |
| 287 container_ = new views::View; | 293 container_ = new views::View; |
| 288 container_->SetLayoutManager(new views::BoxLayout( | 294 container_->SetLayoutManager(new views::BoxLayout( |
| 289 views::BoxLayout::kHorizontal, 5, 0, 3)); | 295 views::BoxLayout::kHorizontal, 5, 0, 3)); |
| 290 container_->set_background(new SystemTrayBackground); | 296 container_->set_background(new SystemTrayBackground); |
| 291 set_border(views::Border::CreateEmptyBorder(0, 0, | 297 set_border(views::Border::CreateEmptyBorder(0, 0, |
| 292 kPaddingFromBottomOfScreen, kPaddingFromRightEdgeOfScreen)); | 298 kPaddingFromBottomOfScreen, kPaddingFromRightEdgeOfScreen)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 314 if (tray_item) { | 320 if (tray_item) { |
| 315 container_->AddChildViewAt(tray_item, 0); | 321 container_->AddChildViewAt(tray_item, 0); |
| 316 PreferredSizeChanged(); | 322 PreferredSizeChanged(); |
| 317 } | 323 } |
| 318 } | 324 } |
| 319 | 325 |
| 320 void SystemTray::RemoveTrayItem(SystemTrayItem* item) { | 326 void SystemTray::RemoveTrayItem(SystemTrayItem* item) { |
| 321 NOTIMPLEMENTED(); | 327 NOTIMPLEMENTED(); |
| 322 } | 328 } |
| 323 | 329 |
| 330 void SystemTray::ShowDefaultView() { |
| 331 if (popup_) { |
| 332 popup_->RemoveObserver(this); |
| 333 popup_->Close(); |
| 334 } |
| 335 popup_ = NULL; |
| 336 bubble_ = NULL; |
| 337 |
| 338 ShowItems(items_, false, true); |
| 339 } |
| 340 |
| 324 void SystemTray::ShowDetailedView(SystemTrayItem* item, | 341 void SystemTray::ShowDetailedView(SystemTrayItem* item, |
| 325 int close_delay, | 342 int close_delay, |
| 326 bool activate) { | 343 bool activate) { |
| 327 if (popup_) { | 344 if (popup_) { |
| 328 popup_->RemoveObserver(this); | 345 popup_->RemoveObserver(this); |
| 329 popup_->Close(); | 346 popup_->Close(); |
| 330 } | 347 } |
| 331 popup_ = NULL; | 348 popup_ = NULL; |
| 332 bubble_ = NULL; | 349 bubble_ = NULL; |
| 333 | 350 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 SchedulePaint(); | 432 SchedulePaint(); |
| 416 } | 433 } |
| 417 | 434 |
| 418 void SystemTray::OnWidgetClosing(views::Widget* widget) { | 435 void SystemTray::OnWidgetClosing(views::Widget* widget) { |
| 419 CHECK_EQ(popup_, widget); | 436 CHECK_EQ(popup_, widget); |
| 420 popup_ = NULL; | 437 popup_ = NULL; |
| 421 bubble_ = NULL; | 438 bubble_ = NULL; |
| 422 } | 439 } |
| 423 | 440 |
| 424 } // namespace ash | 441 } // namespace ash |
| OLD | NEW |