| 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 "chrome/browser/background/background_mode_manager.h" | 5 #include "chrome/browser/background/background_mode_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // static | 431 // static |
| 432 void BackgroundModeManager::LaunchBackgroundApplication( | 432 void BackgroundModeManager::LaunchBackgroundApplication( |
| 433 Profile* profile, | 433 Profile* profile, |
| 434 const Extension* extension) { | 434 const Extension* extension) { |
| 435 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB, | 435 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB, |
| 436 extensions::SOURCE_BACKGROUND)); | 436 extensions::SOURCE_BACKGROUND)); |
| 437 } | 437 } |
| 438 | 438 |
| 439 // static | 439 // static |
| 440 Browser* BackgroundModeManager::GetBrowserWindowForProfile(Profile* profile) { | 440 Browser* BackgroundModeManager::GetBrowserWindowForProfile(Profile* profile) { |
| 441 chrome::HostDesktopType host_desktop_type = chrome::GetActiveDesktop(); | 441 ui::HostDesktopType host_desktop_type = chrome::GetActiveDesktop(); |
| 442 Browser* browser = | 442 Browser* browser = |
| 443 chrome::FindLastActiveWithProfile(profile, host_desktop_type); | 443 chrome::FindLastActiveWithProfile(profile, host_desktop_type); |
| 444 return browser ? browser | 444 return browser ? browser |
| 445 : chrome::OpenEmptyWindow(profile, host_desktop_type); | 445 : chrome::OpenEmptyWindow(profile, host_desktop_type); |
| 446 } | 446 } |
| 447 | 447 |
| 448 bool BackgroundModeManager::IsBackgroundModeActive() { | 448 bool BackgroundModeManager::IsBackgroundModeActive() { |
| 449 return in_background_mode_; | 449 return in_background_mode_; |
| 450 } | 450 } |
| 451 | 451 |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 } | 1076 } |
| 1077 } | 1077 } |
| 1078 return profile_it; | 1078 return profile_it; |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { | 1081 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { |
| 1082 PrefService* service = g_browser_process->local_state(); | 1082 PrefService* service = g_browser_process->local_state(); |
| 1083 DCHECK(service); | 1083 DCHECK(service); |
| 1084 return service->GetBoolean(prefs::kBackgroundModeEnabled); | 1084 return service->GetBoolean(prefs::kBackgroundModeEnabled); |
| 1085 } | 1085 } |
| OLD | NEW |