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

Unified Diff: ui/views/controls/native/native_view_host_aura.cc

Issue 397493005: Make NativeViewHostAura clipping window non-focusable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « ui/views/controls/native/native_view_host_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/native/native_view_host_aura.cc
diff --git a/ui/views/controls/native/native_view_host_aura.cc b/ui/views/controls/native/native_view_host_aura.cc
index 16dc470468d37140a99f650f6c2affc3cabf92c7..231c0466a77be9b9d88b93ceabc215012739b624 100644
--- a/ui/views/controls/native/native_view_host_aura.cc
+++ b/ui/views/controls/native/native_view_host_aura.cc
@@ -8,6 +8,7 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_delegate.h"
#include "ui/base/cursor/cursor.h"
#include "ui/views/controls/native/native_view_host.h"
#include "ui/views/view_constants_aura.h"
@@ -15,9 +16,39 @@
namespace views {
+class NativeViewHostAura::ClippingWindowDelegate : public aura::WindowDelegate {
sky 2014/07/15 04:41:12 Would making NavigateViewHostAura an ActivationDel
calamity 2014/07/15 06:35:01 No dice =( It seems that base_focus_rules.cc only
sky 2014/07/15 16:19:39 What about making NativeViewHostAura itself the Wi
+ public:
+ ClippingWindowDelegate() {}
+ ~ClippingWindowDelegate() {}
+
+ virtual gfx::Size GetMinimumSize() const OVERRIDE { return gfx::Size(); }
+ virtual gfx::Size GetMaximumSize() const OVERRIDE { return gfx::Size(); }
+ virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) OVERRIDE {}
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+ return gfx::kNullCursor;
+ }
+ virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
+ return HTCLIENT;
+ }
+ virtual bool ShouldDescendIntoChildForEventHandling(
+ aura::Window* child,
+ const gfx::Point& location) OVERRIDE { return true; }
+ virtual bool CanFocus() OVERRIDE { return false; }
+ virtual void OnCaptureLost() OVERRIDE {}
+ virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
+ virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {}
+ virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {}
+ virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {}
+ virtual bool HasHitTestMask() const OVERRIDE { return false; }
+ virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {}
+};
+
NativeViewHostAura::NativeViewHostAura(NativeViewHost* host)
: host_(host),
- clipping_window_(NULL) {
+ clipping_window_delegate_(new ClippingWindowDelegate()),
+ clipping_window_(clipping_window_delegate_.get()) {
clipping_window_.Init(aura::WINDOW_LAYER_NOT_DRAWN);
clipping_window_.set_owned_by_parent(false);
clipping_window_.SetName("NativeViewHostAuraClip");
« no previous file with comments | « ui/views/controls/native/native_view_host_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698