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

Unified Diff: chrome/browser/ui/tabs/dock_info_aura.cc

Issue 10083057: Revert 132856 - Aura/ash split: Remove hacks and get chrome linking without ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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: chrome/browser/ui/tabs/dock_info_aura.cc
===================================================================
--- chrome/browser/ui/tabs/dock_info_aura.cc (revision 132861)
+++ chrome/browser/ui/tabs/dock_info_aura.cc (working copy)
@@ -4,10 +4,44 @@
#include "chrome/browser/ui/tabs/dock_info.h"
+#include "ash/shell.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/gfx/compositor/layer.h"
-#if !defined(USE_ASH)
+// DockInfo -------------------------------------------------------------------
+namespace {
+
+aura::Window* GetLocalProcessWindowAtPointImpl(
+ const gfx::Point& screen_point,
+ const std::set<gfx::NativeView>& ignore,
+ aura::Window* window) {
+ if (ignore.find(window) != ignore.end())
+ return NULL;
+
+ if (!window->IsVisible())
+ return NULL;
+
+ if (window->layer()->type() == ui::LAYER_TEXTURED) {
+ gfx::Point window_point(screen_point);
+ aura::Window::ConvertPointToWindow(ash::Shell::GetRootWindow(), window,
+ &window_point);
+ return gfx::Rect(window->bounds().size()).Contains(window_point) ?
+ window : NULL;
+ }
+ for (aura::Window::Windows::const_reverse_iterator i =
+ window->children().rbegin(); i != window->children().rend(); ++i) {
+ aura::Window* result =
+ GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i);
+ if (result)
+ return result;
+ }
+ return NULL;
+}
+
+} // namespace
+
// static
DockInfo DockInfo::GetDockInfoAtPoint(const gfx::Point& screen_point,
const std::set<gfx::NativeView>& ignore) {
@@ -20,8 +54,8 @@
gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint(
const gfx::Point& screen_point,
const std::set<gfx::NativeView>& ignore) {
- NOTIMPLEMENTED();
- return NULL;
+ return GetLocalProcessWindowAtPointImpl(
+ screen_point, ignore, ash::Shell::GetRootWindow());
}
bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const {
@@ -34,5 +68,3 @@
void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const {
window_->SetBounds(bounds);
}
-
-#endif
« no previous file with comments | « chrome/browser/ui/tabs/dock_info_ash.cc ('k') | chrome/browser/ui/views/accessibility_event_router_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698