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

Side by Side Diff: chrome/browser/chromeos/app_mode/app_session_lifetime.cc

Issue 16702003: Move ShellWindow into apps component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yar Created 7 years, 5 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
« no previous file with comments | « apps/shell_window.cc ('k') | chrome/browser/extensions/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/app_mode/app_session_lifetime.h" 5 #include "chrome/browser/chromeos/app_mode/app_session_lifetime.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 18 matching lines...) Expand all
29 29
30 void Init(Profile* profile) { 30 void Init(Profile* profile) {
31 DCHECK(!window_registry_); 31 DCHECK(!window_registry_);
32 window_registry_ = ShellWindowRegistry::Get(profile); 32 window_registry_ = ShellWindowRegistry::Get(profile);
33 if (window_registry_) 33 if (window_registry_)
34 window_registry_->AddObserver(this); 34 window_registry_->AddObserver(this);
35 } 35 }
36 36
37 private: 37 private:
38 // extensions::ShellWindowRegistry::Observer overrides: 38 // extensions::ShellWindowRegistry::Observer overrides:
39 virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE {} 39 virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE {}
40 virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE {} 40 virtual void OnShellWindowIconChanged(apps::ShellWindow* shell_window)
41 virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE { 41 OVERRIDE {}
42 virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE {
42 if (window_registry_->shell_windows().empty()) { 43 if (window_registry_->shell_windows().empty()) {
43 chrome::AttemptUserExit(); 44 chrome::AttemptUserExit();
44 window_registry_->RemoveObserver(this); 45 window_registry_->RemoveObserver(this);
45 } 46 }
46 } 47 }
47 48
48 extensions::ShellWindowRegistry* window_registry_; 49 extensions::ShellWindowRegistry* window_registry_;
49 50
50 DISALLOW_COPY_AND_ASSIGN(AppWindowWatcher); 51 DISALLOW_COPY_AND_ASSIGN(AppWindowWatcher);
51 }; 52 };
(...skipping 16 matching lines...) Expand all
68 update_service->set_app_id(app_id); 69 update_service->set_app_id(app_id);
69 70
70 // If the device is not enterprise managed, set prefs to reboot after update. 71 // If the device is not enterprise managed, set prefs to reboot after update.
71 if (!g_browser_process->browser_policy_connector()->IsEnterpriseManaged()) { 72 if (!g_browser_process->browser_policy_connector()->IsEnterpriseManaged()) {
72 PrefService* local_state = g_browser_process->local_state(); 73 PrefService* local_state = g_browser_process->local_state();
73 local_state->SetBoolean(prefs::kRebootAfterUpdate, true); 74 local_state->SetBoolean(prefs::kRebootAfterUpdate, true);
74 } 75 }
75 } 76 }
76 77
77 } // namespace chromeos 78 } // namespace chromeos
OLDNEW
« no previous file with comments | « apps/shell_window.cc ('k') | chrome/browser/extensions/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698