| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/message_center/web_notification_tray.h" | 5 #include "chrome/browser/ui/views/message_center/web_notification_tray.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 if (!status_tray) | 344 if (!status_tray) |
| 345 return; | 345 return; |
| 346 | 346 |
| 347 status_icon_ = status_tray->CreateStatusIcon( | 347 status_icon_ = status_tray->CreateStatusIcon( |
| 348 StatusTray::NOTIFICATION_TRAY_ICON, image, tool_tip); | 348 StatusTray::NOTIFICATION_TRAY_ICON, image, tool_tip); |
| 349 if (!status_icon_) | 349 if (!status_icon_) |
| 350 return; | 350 return; |
| 351 | 351 |
| 352 status_icon_->AddObserver(this); | 352 status_icon_->AddObserver(this); |
| 353 AddQuietModeMenu(status_icon_); | 353 AddQuietModeMenu(status_icon_); |
| 354 #if defined(OS_WIN) | |
| 355 if (did_force_tray_visible_.get() && !did_force_tray_visible_->GetValue()) { | |
| 356 EnforceStatusIconVisible(); | |
| 357 did_force_tray_visible_->SetValue(true); | |
| 358 } | |
| 359 #endif | |
| 360 } | 354 } |
| 361 | 355 |
| 362 void WebNotificationTray::DestroyStatusIcon() { | 356 void WebNotificationTray::DestroyStatusIcon() { |
| 363 if (!status_icon_) | 357 if (!status_icon_) |
| 364 return; | 358 return; |
| 365 | 359 |
| 366 status_icon_->RemoveObserver(this); | 360 status_icon_->RemoveObserver(this); |
| 367 StatusTray* status_tray = g_browser_process->status_tray(); | 361 StatusTray* status_tray = g_browser_process->status_tray(); |
| 368 if (status_tray) | 362 if (status_tray) |
| 369 status_tray->RemoveStatusIcon(status_icon_); | 363 status_tray->RemoveStatusIcon(status_icon_); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 386 status_icon_menu_ = menu.get(); | 380 status_icon_menu_ = menu.get(); |
| 387 status_icon->SetContextMenu(menu.Pass()); | 381 status_icon->SetContextMenu(menu.Pass()); |
| 388 } | 382 } |
| 389 | 383 |
| 390 MessageCenterWidgetDelegate* | 384 MessageCenterWidgetDelegate* |
| 391 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { | 385 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { |
| 392 return message_center_delegate_; | 386 return message_center_delegate_; |
| 393 } | 387 } |
| 394 | 388 |
| 395 } // namespace message_center | 389 } // namespace message_center |
| OLD | NEW |