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

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

Issue 722703002: Make "source" a required argument of AppLaunchParams and fill in the argument in all call points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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"
35 #include "chrome/browser/ui/extensions/application_launch.h" 36 #include "chrome/browser/ui/extensions/application_launch.h"
36 #include "chrome/browser/ui/host_desktop.h" 37 #include "chrome/browser/ui/host_desktop.h"
37 #include "chrome/browser/ui/user_manager.h" 38 #include "chrome/browser/ui/user_manager.h"
38 #include "chrome/common/chrome_constants.h" 39 #include "chrome/common/chrome_constants.h"
39 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
40 #include "chrome/common/extensions/extension_constants.h" 41 #include "chrome/common/extensions/extension_constants.h"
41 #include "chrome/common/pref_names.h" 42 #include "chrome/common/pref_names.h"
42 #include "chrome/grit/chromium_strings.h" 43 #include "chrome/grit/chromium_strings.h"
43 #include "chrome/grit/generated_resources.h" 44 #include "chrome/grit/generated_resources.h"
44 #include "content/public/browser/notification_service.h" 45 #include "content/public/browser/notification_service.h"
45 #include "content/public/browser/user_metrics.h" 46 #include "content/public/browser/user_metrics.h"
46 #include "extensions/browser/extension_system.h" 47 #include "extensions/browser/extension_system.h"
48 #include "extensions/common/constants.h"
47 #include "extensions/common/extension.h" 49 #include "extensions/common/extension.h"
48 #include "extensions/common/manifest_handlers/options_page_info.h" 50 #include "extensions/common/manifest_handlers/options_page_info.h"
49 #include "extensions/common/permissions/permission_set.h" 51 #include "extensions/common/permissions/permission_set.h"
50 #include "grit/chrome_unscaled_resources.h" 52 #include "grit/chrome_unscaled_resources.h"
51 #include "ui/base/l10n/l10n_util.h" 53 #include "ui/base/l10n/l10n_util.h"
52 #include "ui/base/resource/resource_bundle.h" 54 #include "ui/base/resource/resource_bundle.h"
53 55
54 using base::UserMetricsAction; 56 using base::UserMetricsAction;
55 using extensions::Extension; 57 using extensions::Extension;
56 using extensions::UpdatedExtensionPermissionsInfo; 58 using extensions::UpdatedExtensionPermissionsInfo;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // If we're adding a new profile and running in multi-profile mode, this new 313 // If we're adding a new profile and running in multi-profile mode, this new
312 // profile should be added to the status icon if one currently exists. 314 // profile should be added to the status icon if one currently exists.
313 if (in_background_mode_ && status_icon_) 315 if (in_background_mode_ && status_icon_)
314 UpdateStatusTrayIconContextMenu(); 316 UpdateStatusTrayIconContextMenu();
315 } 317 }
316 318
317 // static 319 // static
318 void BackgroundModeManager::LaunchBackgroundApplication( 320 void BackgroundModeManager::LaunchBackgroundApplication(
319 Profile* profile, 321 Profile* profile,
320 const Extension* extension) { 322 const Extension* extension) {
321 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB)); 323 OpenApplication(AppLaunchParams(profile, extension, NEW_FOREGROUND_TAB,
324 extensions::SOURCE_BACKGROUND));
322 } 325 }
323 326
324 bool BackgroundModeManager::IsBackgroundModeActive() { 327 bool BackgroundModeManager::IsBackgroundModeActive() {
325 return in_background_mode_; 328 return in_background_mode_;
326 } 329 }
327 330
328 int BackgroundModeManager::NumberOfBackgroundModeData() { 331 int BackgroundModeManager::NumberOfBackgroundModeData() {
329 return background_mode_data_.size(); 332 return background_mode_data_.size();
330 } 333 }
331 334
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 } 840 }
838 } 841 }
839 return profile_it; 842 return profile_it;
840 } 843 }
841 844
842 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 845 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
843 PrefService* service = g_browser_process->local_state(); 846 PrefService* service = g_browser_process->local_state();
844 DCHECK(service); 847 DCHECK(service);
845 return service->GetBoolean(prefs::kBackgroundModeEnabled); 848 return service->GetBoolean(prefs::kBackgroundModeEnabled);
846 } 849 }
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