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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 return; | 658 return; |
659 | 659 |
660 status_icon_ = status_tray_->CreateStatusIcon(); | 660 status_icon_ = status_tray_->CreateStatusIcon(); |
661 if (!status_icon_) | 661 if (!status_icon_) |
662 return; | 662 return; |
663 | 663 |
664 // Set the image and add ourselves as a click observer on it. | 664 // Set the image and add ourselves as a click observer on it. |
665 // TODO(rlp): Status tray icon should have submenus for each profile. | 665 // TODO(rlp): Status tray icon should have submenus for each profile. |
666 gfx::ImageSkia* image_skia = ResourceBundle::GetSharedInstance(). | 666 gfx::ImageSkia* image_skia = ResourceBundle::GetSharedInstance(). |
667 GetImageSkiaNamed(IDR_STATUS_TRAY_ICON); | 667 GetImageSkiaNamed(IDR_STATUS_TRAY_ICON); |
668 status_icon_->SetImage(*image_skia); | 668 status_icon_->SetImage(*image_skia->bitmap()); |
669 status_icon_->SetToolTip(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 669 status_icon_->SetToolTip(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
670 UpdateStatusTrayIconContextMenu(); | 670 UpdateStatusTrayIconContextMenu(); |
671 } | 671 } |
672 | 672 |
673 void BackgroundModeManager::UpdateStatusTrayIconContextMenu() { | 673 void BackgroundModeManager::UpdateStatusTrayIconContextMenu() { |
674 // If no status icon exists, it's either because one wasn't created when | 674 // If no status icon exists, it's either because one wasn't created when |
675 // it should have been which can happen when extensions load after the | 675 // it should have been which can happen when extensions load after the |
676 // profile has already been registered with the background mode manager. | 676 // profile has already been registered with the background mode manager. |
677 if (in_background_mode_ && !status_icon_) | 677 if (in_background_mode_ && !status_icon_) |
678 CreateStatusTrayIcon(); | 678 CreateStatusTrayIcon(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 } | 768 } |
769 } | 769 } |
770 return profile_it; | 770 return profile_it; |
771 } | 771 } |
772 | 772 |
773 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { | 773 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { |
774 PrefService* service = g_browser_process->local_state(); | 774 PrefService* service = g_browser_process->local_state(); |
775 DCHECK(service); | 775 DCHECK(service); |
776 return service->GetBoolean(prefs::kBackgroundModeEnabled); | 776 return service->GetBoolean(prefs::kBackgroundModeEnabled); |
777 } | 777 } |
OLD | NEW |