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

Unified Diff: chrome/browser/ui/views/tabs/window_finder_mus.cc

Issue 2449103004: Refactor WindowFinder definition (Closed)
Patch Set: addressed more of sky's feedback Created 4 years, 1 month 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: chrome/browser/ui/views/tabs/window_finder_mus.cc
diff --git a/chrome/browser/ui/views/tabs/window_finder_mus.cc b/chrome/browser/ui/views/tabs/window_finder_mus.cc
index c42aec3a897db645a9955c554024a3436957e4bb..4b1fb666ab9ff7d9674892f1b337f0a924d4435a 100644
--- a/chrome/browser/ui/views/tabs/window_finder_mus.cc
+++ b/chrome/browser/ui/views/tabs/window_finder_mus.cc
@@ -4,17 +4,22 @@
#include "chrome/browser/ui/views/tabs/window_finder_mus.h"
+#include "content/public/common/service_manager_connection.h" // nogncheck
+#include "services/service_manager/runner/common/client_util.h" // nogncheck
#include "ui/aura/window.h"
#include "ui/views/mus/native_widget_mus.h"
#include "ui/views/mus/window_manager_connection.h"
-WindowFinderMus::WindowFinderMus() {}
+bool GetLocalProcessWindowAtPointMus(
+ const gfx::Point& screen_point,
+ const std::set<gfx::NativeWindow>& ignore,
+ gfx::NativeWindow* out) {
-WindowFinderMus::~WindowFinderMus() {}
+ content::ServiceManagerConnection* service_manager_connection =
+ content::ServiceManagerConnection::GetForProcess();
+ if (!service_manager_connection || !service_manager::ServiceManagerIsRemote())
+ return false;
-gfx::NativeWindow WindowFinderMus::GetLocalProcessWindowAtPoint(
- const gfx::Point& screen_point,
- const std::set<gfx::NativeWindow>& ignore) {
std::set<ui::Window*> mus_windows =
views::WindowManagerConnection::Get()->GetRoots();
// TODO(erg): Needs to deal with stacking order here.
@@ -30,9 +35,10 @@ gfx::NativeWindow WindowFinderMus::GetLocalProcessWindowAtPoint(
if (base::ContainsKey(ignore, content_window))
continue;
- return content_window;
+ *out = content_window;
+ return true;
}
}
- return nullptr;
+ return false;
}

Powered by Google App Engine
This is Rietveld 408576698