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

Unified Diff: components/arc/arc_util.cc

Issue 2877883002: Consolidate two IsArcWindow functions to reduce code duplication (Closed)
Patch Set: review 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
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);
+}
+
} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698