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

Unified Diff: components/arc/arc_util.cc

Issue 2877883002: Consolidate two IsArcWindow functions to reduce code duplication (Closed)
Patch Set: address comments from Luis Created 3 years, 7 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 | « components/arc/arc_util.h ('k') | components/arc/arc_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_util.cc
diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
index 7c3ee3f5a080b7e1b4d0b82dc0bbc686873c5b5e..2e106f71c7853ced3ef2f7d0c00f97e124ba7199 100644
--- a/components/arc/arc_util.cc
+++ b/components/arc/arc_util.cc
@@ -6,6 +6,8 @@
#include <string>
+#include "ash/shared/app_types.h"
+#include "ash/wm_window.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "chromeos/chromeos_switches.h"
@@ -111,4 +113,12 @@ bool IsArcOptInVerificationDisabled() {
chromeos::switches::kDisableArcOptInVerification);
}
+bool IsArcAppWindow(aura::Window* window) {
+ // The getter returns nullptr when |window| is nullptr.
+ ash::WmWindow* wm_window = ash::WmWindow::Get(window);
+ if (!wm_window)
+ return false;
+ return wm_window->GetAppType() == static_cast<int>(ash::AppType::ARC_APP);
oshima 2017/05/13 01:06:09 Could you please use GetProperty(aura::client::kAp
Yusuke Sato 2017/05/15 21:57:50 Done.
+}
+
} // namespace arc
« no previous file with comments | « components/arc/arc_util.h ('k') | components/arc/arc_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698