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

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

Issue 6831016: Profile shouldn't own background page stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_MODE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_BACKGROUND_MODE_MANAGER_H_
6 #define CHROME_BROWSER_BACKGROUND_MODE_MANAGER_H_ 6 #define CHROME_BROWSER_BACKGROUND_MODE_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "chrome/browser/background_application_list_model.h" 10 #include "chrome/browser/background_application_list_model.h"
11 #include "chrome/browser/prefs/pref_change_registrar.h" 11 #include "chrome/browser/prefs/pref_change_registrar.h"
12 #include "chrome/browser/profiles/profile_keyed_service.h"
12 #include "chrome/browser/status_icons/status_icon.h" 13 #include "chrome/browser/status_icons/status_icon.h"
13 #include "content/common/notification_observer.h" 14 #include "content/common/notification_observer.h"
14 #include "content/common/notification_registrar.h" 15 #include "content/common/notification_registrar.h"
15 #include "ui/base/models/simple_menu_model.h" 16 #include "ui/base/models/simple_menu_model.h"
16 17
17 class Browser; 18 class Browser;
18 class CommandLine; 19 class CommandLine;
19 class Extension; 20 class Extension;
20 class PrefService; 21 class PrefService;
21 class Profile; 22 class Profile;
(...skipping 10 matching lines...) Expand all
32 // mode at the appropriate time. 33 // mode at the appropriate time.
33 // 34 //
34 // When Chrome is in background mode, it will continue running even after the 35 // When Chrome is in background mode, it will continue running even after the
35 // last browser window is closed, until the user explicitly exits the app. 36 // last browser window is closed, until the user explicitly exits the app.
36 // Additionally, when in background mode, Chrome will launch on OS login with 37 // Additionally, when in background mode, Chrome will launch on OS login with
37 // no open windows to allow apps with the "background" permission to run in the 38 // no open windows to allow apps with the "background" permission to run in the
38 // background. 39 // background.
39 class BackgroundModeManager 40 class BackgroundModeManager
40 : public NotificationObserver, 41 : public NotificationObserver,
41 public ui::SimpleMenuModel::Delegate, 42 public ui::SimpleMenuModel::Delegate,
42 public BackgroundApplicationListModel::Observer { 43 public BackgroundApplicationListModel::Observer,
44 public ProfileKeyedService {
43 public: 45 public:
44 BackgroundModeManager(Profile* profile, CommandLine* command_line); 46 BackgroundModeManager(Profile* profile, CommandLine* command_line);
45 virtual ~BackgroundModeManager(); 47 virtual ~BackgroundModeManager();
46 48
47 static bool IsBackgroundModeEnabled(const CommandLine* command_line); 49 static bool IsBackgroundModeEnabled(const CommandLine* command_line);
48 50
49 private: 51 private:
50 friend class TestBackgroundModeManager; 52 friend class TestBackgroundModeManager;
51 friend class BackgroundModeManagerTest; 53 friend class BackgroundModeManagerTest;
52 FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest, 54 FRIEND_TEST_ALL_PREFIXES(BackgroundModeManagerTest,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // platform doesn't support status icons. 178 // platform doesn't support status icons.
177 StatusTray* status_tray_; 179 StatusTray* status_tray_;
178 180
179 // Reference to our status icon (if any) - owned by the StatusTray. 181 // Reference to our status icon (if any) - owned by the StatusTray.
180 StatusIcon* status_icon_; 182 StatusIcon* status_icon_;
181 183
182 DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager); 184 DISALLOW_COPY_AND_ASSIGN(BackgroundModeManager);
183 }; 185 };
184 186
185 #endif // CHROME_BROWSER_BACKGROUND_MODE_MANAGER_H_ 187 #endif // CHROME_BROWSER_BACKGROUND_MODE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/background_contents_service_factory.cc ('k') | chrome/browser/background_mode_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698