| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "app/resource_bundle.h" | 6 #include "app/resource_bundle.h" |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 int command_id, | 309 int command_id, |
| 310 menus::Accelerator* accelerator) { | 310 menus::Accelerator* accelerator) { |
| 311 // No accelerators for status icon context menus. | 311 // No accelerators for status icon context menus. |
| 312 return false; | 312 return false; |
| 313 } | 313 } |
| 314 | 314 |
| 315 void BackgroundModeManager::RemoveStatusTrayIcon() { | 315 void BackgroundModeManager::RemoveStatusTrayIcon() { |
| 316 if (status_icon_) | 316 if (status_icon_) |
| 317 status_tray_->RemoveStatusIcon(status_icon_); | 317 status_tray_->RemoveStatusIcon(status_icon_); |
| 318 status_icon_ = NULL; | 318 status_icon_ = NULL; |
| 319 context_menu_ = NULL; // Do not delete, points within status_icon_ |
| 319 } | 320 } |
| 320 | 321 |
| 321 void BackgroundModeManager::ExecuteApplication(int item) { | 322 void BackgroundModeManager::ExecuteApplication(int item) { |
| 322 DCHECK(item >= 0 && item < static_cast<int>(applications_.size())); | 323 DCHECK(item >= 0 && item < static_cast<int>(applications_.size())); |
| 323 Browser* browser = BrowserList::GetLastActive(); | 324 Browser* browser = BrowserList::GetLastActive(); |
| 324 if (!browser) { | 325 if (!browser) { |
| 325 Browser::OpenEmptyWindow(profile_); | 326 Browser::OpenEmptyWindow(profile_); |
| 326 browser = BrowserList::GetLastActive(); | 327 browser = BrowserList::GetLastActive(); |
| 327 } | 328 } |
| 328 const Extension* extension = applications_.GetExtension(item); | 329 const Extension* extension = applications_.GetExtension(item); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // is always running on that platform, making it superfluous. | 369 // is always running on that platform, making it superfluous. |
| 369 #if defined(OS_CHROMEOS) | 370 #if defined(OS_CHROMEOS) |
| 370 return false; | 371 return false; |
| 371 #else | 372 #else |
| 372 bool background_mode_enabled = | 373 bool background_mode_enabled = |
| 373 !command_line->HasSwitch(switches::kDisableBackgroundMode) && | 374 !command_line->HasSwitch(switches::kDisableBackgroundMode) && |
| 374 !command_line->HasSwitch(switches::kDisableExtensions); | 375 !command_line->HasSwitch(switches::kDisableExtensions); |
| 375 return background_mode_enabled; | 376 return background_mode_enabled; |
| 376 #endif | 377 #endif |
| 377 } | 378 } |
| OLD | NEW |