OLD | NEW |
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 "apps/app_lifetime_monitor.h" | 5 #include "apps/app_lifetime_monitor.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "content/public/browser/notification_details.h" | 9 #include "content/public/browser/notification_details.h" |
10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 if (!HasVisibleAppWindows(app_window)) | 84 if (!HasVisibleAppWindows(app_window)) |
85 NotifyAppDeactivated(app_window->extension_id()); | 85 NotifyAppDeactivated(app_window->extension_id()); |
86 } | 86 } |
87 | 87 |
88 void AppLifetimeMonitor::OnAppWindowHidden(AppWindow* app_window) { | 88 void AppLifetimeMonitor::OnAppWindowHidden(AppWindow* app_window) { |
89 if (!HasVisibleAppWindows(app_window)) | 89 if (!HasVisibleAppWindows(app_window)) |
90 NotifyAppDeactivated(app_window->extension_id()); | 90 NotifyAppDeactivated(app_window->extension_id()); |
91 } | 91 } |
92 | 92 |
93 void AppLifetimeMonitor::OnAppWindowShown(AppWindow* app_window) { | 93 void AppLifetimeMonitor::OnAppWindowShown(AppWindow* app_window) { |
94 if (app_window->window_type() != AppWindow::WINDOW_TYPE_DEFAULT) | 94 if (app_window->window_type() != native_app_window::WINDOW_TYPE_DEFAULT) |
95 return; | 95 return; |
96 | 96 |
97 if (HasVisibleAppWindows(app_window)) | 97 if (HasVisibleAppWindows(app_window)) |
98 NotifyAppActivated(app_window->extension_id()); | 98 NotifyAppActivated(app_window->extension_id()); |
99 } | 99 } |
100 | 100 |
101 void AppLifetimeMonitor::Shutdown() { | 101 void AppLifetimeMonitor::Shutdown() { |
102 AppWindowRegistry* app_window_registry = | 102 AppWindowRegistry* app_window_registry = |
103 AppWindowRegistry::Factory::GetForBrowserContext(profile_, | 103 AppWindowRegistry::Factory::GetForBrowserContext(profile_, |
104 false /* create */); | 104 false /* create */); |
(...skipping 29 matching lines...) Expand all Loading... |
134 | 134 |
135 void AppLifetimeMonitor::NotifyAppStop(const std::string& app_id) { | 135 void AppLifetimeMonitor::NotifyAppStop(const std::string& app_id) { |
136 FOR_EACH_OBSERVER(Observer, observers_, OnAppStop(profile_, app_id)); | 136 FOR_EACH_OBSERVER(Observer, observers_, OnAppStop(profile_, app_id)); |
137 } | 137 } |
138 | 138 |
139 void AppLifetimeMonitor::NotifyChromeTerminating() { | 139 void AppLifetimeMonitor::NotifyChromeTerminating() { |
140 FOR_EACH_OBSERVER(Observer, observers_, OnChromeTerminating()); | 140 FOR_EACH_OBSERVER(Observer, observers_, OnChromeTerminating()); |
141 } | 141 } |
142 | 142 |
143 } // namespace apps | 143 } // namespace apps |
OLD | NEW |