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

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

Issue 1376063005: Cleanup: Pull some browser keep alive functions into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 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 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_
6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 18 matching lines...) Expand all
29 class PrefRegistrySimple; 29 class PrefRegistrySimple;
30 class Profile; 30 class Profile;
31 class ProfileInfoCache; 31 class ProfileInfoCache;
32 class StatusIcon; 32 class StatusIcon;
33 class StatusTray; 33 class StatusTray;
34 34
35 namespace base { 35 namespace base {
36 class CommandLine; 36 class CommandLine;
37 } 37 }
38 38
39 namespace browser_lifetime {
40 class ScopedKeepAlive;
41 }
42
39 typedef std::vector<base::Closure> CommandIdHandlerVector; 43 typedef std::vector<base::Closure> CommandIdHandlerVector;
40 44
41 // BackgroundModeManager is responsible for switching Chrome into and out of 45 // BackgroundModeManager is responsible for switching Chrome into and out of
42 // "background mode" and for providing UI for the user to exit Chrome when there 46 // "background mode" and for providing UI for the user to exit Chrome when there
43 // are no open browser windows. 47 // are no open browser windows.
44 // 48 //
45 // Chrome enters background mode whenever there is an application with the 49 // Chrome enters background mode whenever there is an application with the
46 // "background" permission installed, or a "trigger" that requires Chrome to be 50 // "background" permission installed, or a "trigger" that requires Chrome to be
47 // running. This class monitors the set of installed/loaded extensions to ensure 51 // running. This class monitors the set of installed/loaded extensions to ensure
48 // that Chrome enters/exits background mode at the appropriate time. 52 // that Chrome enters/exits background mode at the appropriate time.
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 410
407 // Reference to our status icon's context menu (if any) - owned by the 411 // Reference to our status icon's context menu (if any) - owned by the
408 // status_icon_. 412 // status_icon_.
409 StatusIconMenuModel* context_menu_; 413 StatusIconMenuModel* context_menu_;
410 414
411 // Set to true when we are running in background mode. Allows us to track our 415 // Set to true when we are running in background mode. Allows us to track our
412 // current background state so we can take the appropriate action when the 416 // current background state so we can take the appropriate action when the
413 // user disables/enables background mode via preferences. 417 // user disables/enables background mode via preferences.
414 bool in_background_mode_; 418 bool in_background_mode_;
415 419
416 // Set when we are keeping chrome running during the startup process - this 420 // Set when we are keeping Chrome running during the startup process - this
417 // is required when running with the --no-startup-window flag, as otherwise 421 // is required when running with the --no-startup-window flag, as otherwise
418 // chrome would immediately exit due to having no open windows. 422 // chrome would immediately exit due to having no open windows.
419 bool keep_alive_for_startup_; 423 scoped_ptr<browser_lifetime::ScopedKeepAlive> keep_alive_for_startup_;
420 424
421 // Set to true when Chrome is running with the --keep-alive-for-test flag 425 // Set to true when Chrome is running with the --keep-alive-for-test flag
422 // (used for testing background mode without having to install a background 426 // (used for testing background mode without having to install a background
423 // app). 427 // app).
424 bool keep_alive_for_test_; 428 bool keep_alive_for_test_;
425 429
426 // Set to true when background mode is suspended. 430 // Set to true when background mode is suspended.
427 bool background_mode_suspended_; 431 bool background_mode_suspended_;
428 432
429 // Set to true when background mode is keeping Chrome alive. 433 // Set to true when background mode is keeping Chrome alive.
430 bool keeping_alive_; 434 scoped_ptr<browser_lifetime::ScopedKeepAlive> keep_alive_for_background_mode_;
431 435
432 base::WeakPtrFactory<BackgroundModeManager> weak_factory_; 436 base::WeakPtrFactory<BackgroundModeManager> weak_factory_;
433 437
434 DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); 438 DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager);
435 }; 439 };
436 440
437 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_ 441 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/apps/scoped_keep_alive.cc ('k') | chrome/browser/background/background_mode_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698