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

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

Issue 2449103004: Refactor WindowFinder definition (Closed)
Patch Set: setting mus_window to null, for safety 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
« no previous file with comments | « chrome/browser/ui/views/tabs/window_finder_mus.h ('k') | chrome/browser/ui/views/tabs/window_finder_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..44614f52fce0d0505675428538ad295e0f16ef8d 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() {}
-
-WindowFinderMus::~WindowFinderMus() {}
-
-gfx::NativeWindow WindowFinderMus::GetLocalProcessWindowAtPoint(
+bool GetLocalProcessWindowAtPointMus(
const gfx::Point& screen_point,
- const std::set<gfx::NativeWindow>& ignore) {
+ const std::set<gfx::NativeWindow>& ignore,
+ gfx::NativeWindow* mus_result) {
+ *mus_result = nullptr;
+ content::ServiceManagerConnection* service_manager_connection =
+ content::ServiceManagerConnection::GetForProcess();
+ if (!service_manager_connection || !service_manager::ServiceManagerIsRemote())
+ return false;
+
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;
+ *mus_result = content_window;
+ return true;
}
}
- return nullptr;
+ return true;
}
« no previous file with comments | « chrome/browser/ui/views/tabs/window_finder_mus.h ('k') | chrome/browser/ui/views/tabs/window_finder_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698