Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/browser/background/background_mode_manager.cc

Issue 1662783002: Remove HostDesktopType from Browser::CreateParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-12
Patch Set: remove desktop_type_ in bookmark_bubble_sign_in_delegate Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // static 392 // static
393 void BackgroundModeManager::LaunchBackgroundApplication( 393 void BackgroundModeManager::LaunchBackgroundApplication(
394 Profile* profile, 394 Profile* profile,
395 const Extension* extension) { 395 const Extension* extension) {
396 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB, 396 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB,
397 extensions::SOURCE_BACKGROUND)); 397 extensions::SOURCE_BACKGROUND));
398 } 398 }
399 399
400 // static 400 // static
401 Browser* BackgroundModeManager::GetBrowserWindowForProfile(Profile* profile) { 401 Browser* BackgroundModeManager::GetBrowserWindowForProfile(Profile* profile) {
402 chrome::HostDesktopType host_desktop_type = chrome::GetActiveDesktop();
403 Browser* browser = chrome::FindLastActiveWithProfile(profile); 402 Browser* browser = chrome::FindLastActiveWithProfile(profile);
404 return browser ? browser 403 return browser ? browser : chrome::OpenEmptyWindow(profile);
405 : chrome::OpenEmptyWindow(profile, host_desktop_type);
406 } 404 }
407 405
408 bool BackgroundModeManager::IsBackgroundModeActive() { 406 bool BackgroundModeManager::IsBackgroundModeActive() {
409 return in_background_mode_; 407 return in_background_mode_;
410 } 408 }
411 409
412 int BackgroundModeManager::NumberOfBackgroundModeData() { 410 int BackgroundModeManager::NumberOfBackgroundModeData() {
413 return background_mode_data_.size(); 411 return background_mode_data_.size();
414 } 412 }
415 413
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 } 1019 }
1022 } 1020 }
1023 return profile_it; 1021 return profile_it;
1024 } 1022 }
1025 1023
1026 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 1024 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
1027 PrefService* service = g_browser_process->local_state(); 1025 PrefService* service = g_browser_process->local_state();
1028 DCHECK(service); 1026 DCHECK(service);
1029 return service->GetBoolean(prefs::kBackgroundModeEnabled); 1027 return service->GetBoolean(prefs::kBackgroundModeEnabled);
1030 } 1028 }
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/captive_portal/captive_portal_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698