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

Side by Side Diff: apps/app_lifetime_monitor.cc

Issue 616253002: Extract NativeAppWindow from src/extensions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: might fix athena. similarity=33 Created 6 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
« no previous file with comments | « no previous file | apps/apps.gypi » ('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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | apps/apps.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698