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

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

Issue 720633003: Revert of CL 722703002 due to build breakage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert Created 6 years 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 <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 14 matching lines...) Expand all
25 #include "chrome/browser/profiles/profile_info_cache.h" 25 #include "chrome/browser/profiles/profile_info_cache.h"
26 #include "chrome/browser/profiles/profile_manager.h" 26 #include "chrome/browser/profiles/profile_manager.h"
27 #include "chrome/browser/status_icons/status_icon.h" 27 #include "chrome/browser/status_icons/status_icon.h"
28 #include "chrome/browser/status_icons/status_tray.h" 28 #include "chrome/browser/status_icons/status_tray.h"
29 #include "chrome/browser/ui/browser.h" 29 #include "chrome/browser/ui/browser.h"
30 #include "chrome/browser/ui/browser_commands.h" 30 #include "chrome/browser/ui/browser_commands.h"
31 #include "chrome/browser/ui/browser_dialogs.h" 31 #include "chrome/browser/ui/browser_dialogs.h"
32 #include "chrome/browser/ui/browser_finder.h" 32 #include "chrome/browser/ui/browser_finder.h"
33 #include "chrome/browser/ui/browser_list.h" 33 #include "chrome/browser/ui/browser_list.h"
34 #include "chrome/browser/ui/chrome_pages.h" 34 #include "chrome/browser/ui/chrome_pages.h"
35 #include "chrome/browser/ui/extensions/app_launch_params.h"
36 #include "chrome/browser/ui/extensions/application_launch.h" 35 #include "chrome/browser/ui/extensions/application_launch.h"
37 #include "chrome/browser/ui/host_desktop.h" 36 #include "chrome/browser/ui/host_desktop.h"
38 #include "chrome/browser/ui/user_manager.h" 37 #include "chrome/browser/ui/user_manager.h"
39 #include "chrome/common/chrome_constants.h" 38 #include "chrome/common/chrome_constants.h"
40 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
41 #include "chrome/common/extensions/extension_constants.h" 40 #include "chrome/common/extensions/extension_constants.h"
42 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
43 #include "chrome/grit/chromium_strings.h" 42 #include "chrome/grit/chromium_strings.h"
44 #include "chrome/grit/generated_resources.h" 43 #include "chrome/grit/generated_resources.h"
45 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/user_metrics.h" 45 #include "content/public/browser/user_metrics.h"
47 #include "extensions/browser/extension_system.h" 46 #include "extensions/browser/extension_system.h"
48 #include "extensions/common/constants.h"
49 #include "extensions/common/extension.h" 47 #include "extensions/common/extension.h"
50 #include "extensions/common/manifest_handlers/options_page_info.h" 48 #include "extensions/common/manifest_handlers/options_page_info.h"
51 #include "extensions/common/permissions/permission_set.h" 49 #include "extensions/common/permissions/permission_set.h"
52 #include "grit/chrome_unscaled_resources.h" 50 #include "grit/chrome_unscaled_resources.h"
53 #include "ui/base/l10n/l10n_util.h" 51 #include "ui/base/l10n/l10n_util.h"
54 #include "ui/base/resource/resource_bundle.h" 52 #include "ui/base/resource/resource_bundle.h"
55 53
56 using base::UserMetricsAction; 54 using base::UserMetricsAction;
57 using extensions::Extension; 55 using extensions::Extension;
58 using extensions::UpdatedExtensionPermissionsInfo; 56 using extensions::UpdatedExtensionPermissionsInfo;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // If we're adding a new profile and running in multi-profile mode, this new 311 // If we're adding a new profile and running in multi-profile mode, this new
314 // profile should be added to the status icon if one currently exists. 312 // profile should be added to the status icon if one currently exists.
315 if (in_background_mode_ && status_icon_) 313 if (in_background_mode_ && status_icon_)
316 UpdateStatusTrayIconContextMenu(); 314 UpdateStatusTrayIconContextMenu();
317 } 315 }
318 316
319 // static 317 // static
320 void BackgroundModeManager::LaunchBackgroundApplication( 318 void BackgroundModeManager::LaunchBackgroundApplication(
321 Profile* profile, 319 Profile* profile,
322 const Extension* extension) { 320 const Extension* extension) {
323 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB, 321 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB));
324 extensions::SOURCE_BACKGROUND));
325 } 322 }
326 323
327 bool BackgroundModeManager::IsBackgroundModeActive() { 324 bool BackgroundModeManager::IsBackgroundModeActive() {
328 return in_background_mode_; 325 return in_background_mode_;
329 } 326 }
330 327
331 int BackgroundModeManager::NumberOfBackgroundModeData() { 328 int BackgroundModeManager::NumberOfBackgroundModeData() {
332 return background_mode_data_.size(); 329 return background_mode_data_.size();
333 } 330 }
334 331
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 837 }
841 } 838 }
842 return profile_it; 839 return profile_it;
843 } 840 }
844 841
845 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 842 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
846 PrefService* service = g_browser_process->local_state(); 843 PrefService* service = g_browser_process->local_state();
847 DCHECK(service); 844 DCHECK(service);
848 return service->GetBoolean(prefs::kBackgroundModeEnabled); 845 return service->GetBoolean(prefs::kBackgroundModeEnabled);
849 } 846 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher.cc ('k') | chrome/browser/chromeos/app_mode/startup_app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698