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

Unified Diff: chrome/browser/apps/app_window_registry_util.cc

Issue 800473006: Don't include hidden windows in IsAppWindowRegisteredInAnyProfile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/apps/app_window_registry_util.h ('k') | chrome/browser/ui/apps/apps_metro_handler_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/app_window_registry_util.cc
diff --git a/chrome/browser/apps/app_window_registry_util.cc b/chrome/browser/apps/app_window_registry_util.cc
index d6917ce868b4d658241df90a2d1484c45263297d..011d64f4aed7f07da5a2357a57636ca8bbdf3a5a 100644
--- a/chrome/browser/apps/app_window_registry_util.cc
+++ b/chrome/browser/apps/app_window_registry_util.cc
@@ -41,7 +41,7 @@ AppWindow* AppWindowRegistryUtil::GetAppWindowForNativeWindowAnyProfile(
}
// static
-bool AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(
+bool AppWindowRegistryUtil::IsAppWindowVisibleInAnyProfile(
int window_type_mask) {
std::vector<Profile*> profiles =
g_browser_process->profile_manager()->GetLoadedProfiles();
@@ -57,13 +57,12 @@ bool AppWindowRegistryUtil::IsAppWindowRegisteredInAnyProfile(
if (app_windows.empty())
continue;
- if (window_type_mask == 0)
- return true;
-
- for (AppWindowList::const_iterator j = app_windows.begin();
- j != app_windows.end(); ++j) {
- if ((*j)->window_type() & window_type_mask)
+ for (const AppWindow* window : app_windows) {
+ if (!window->is_hidden() &&
+ (window_type_mask == 0 ||
+ (window->window_type() & window_type_mask))) {
tapted 2015/01/06 02:50:47 optional-nit: up to you if you want the curly brac
jackhou1 2015/01/06 06:05:58 Done.
return true;
+ }
}
}
« no previous file with comments | « chrome/browser/apps/app_window_registry_util.h ('k') | chrome/browser/ui/apps/apps_metro_handler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698