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

Unified Diff: ui/views/widget/android/native_widget_android.h

Issue 1403293003: Introduce AndroidFocusRules and NativeWidgetAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: ui/views/widget/android/native_widget_android.h
diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/android/native_widget_android.h
similarity index 87%
copy from ui/views/widget/native_widget_aura.h
copy to ui/views/widget/android/native_widget_android.h
index abe3a8a3d6f90d8c0e1a9f67b7440f3f7531acd0..1294b99d9ee3b070012493a1e977ff874b5faed3 100644
--- a/ui/views/widget/native_widget_aura.h
+++ b/ui/views/widget/android/native_widget_android.h
@@ -1,10 +1,12 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_
-#define UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_
+#ifndef UI_VIEWS_WIDGET_ANDROID_NATIVE_WIDGET_ANDROID_H_
+#define UI_VIEWS_WIDGET_ANDROID_NATIVE_WIDGET_ANDROID_H_
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "ui/aura/client/focus_change_observer.h"
#include "ui/aura/window_delegate.h"
@@ -19,10 +21,20 @@
namespace aura {
class Window;
+class WindowTreeHost;
+namespace client {
+class DefaultCaptureClient;
+class DispatcherClient;
+class ScreenPositionClient;
+class WindowTreeClient;
+}
}
namespace gfx {
class FontList;
}
+namespace wm {
+class FocusController;
+}
namespace views {
@@ -30,7 +42,7 @@ class DropHelper;
class TooltipManagerAura;
class WindowReorderer;
-class VIEWS_EXPORT NativeWidgetAura
+class VIEWS_EXPORT NativeWidgetAndroid
: public internal::NativeWidgetPrivate,
public aura::WindowDelegate,
public aura::WindowObserver,
@@ -39,13 +51,9 @@ class VIEWS_EXPORT NativeWidgetAura
public aura::client::FocusChangeObserver,
public aura::client::DragDropDelegate {
public:
- explicit NativeWidgetAura(internal::NativeWidgetDelegate* delegate);
+ explicit NativeWidgetAndroid(internal::NativeWidgetDelegate* delegate);
- // Called internally by NativeWidgetAura and DesktopNativeWidgetAura to
- // associate |native_widget| with |window|.
- static void RegisterNativeWidgetForWindow(
- internal::NativeWidgetPrivate* native_widget,
- aura::Window* window);
+ aura::WindowTreeHost* host() { return host_.get(); }
// Overridden from internal::NativeWidgetPrivate:
void InitNativeWidget(const Widget::InitParams& params) override;
@@ -184,7 +192,7 @@ class VIEWS_EXPORT NativeWidgetAura
int OnPerformDrop(const ui::DropTargetEvent& event) override;
protected:
- ~NativeWidgetAura() override;
+ ~NativeWidgetAndroid() override;
internal::NativeWidgetDelegate* delegate() { return delegate_; }
@@ -221,13 +229,20 @@ class VIEWS_EXPORT NativeWidgetAura
scoped_ptr<DropHelper> drop_helper_;
int last_drop_operation_;
- // The following factory is used for calls to close the NativeWidgetAura
+ scoped_ptr<aura::WindowTreeHost> host_;
+ scoped_ptr<wm::FocusController> focus_client_;
+ scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
+ scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
+ scoped_ptr<aura::client::ScreenPositionClient> screen_position_client_;
+ scoped_ptr<aura::client::DispatcherClient> dispatcher_client_;
+
+ // The following factory is used for calls to close the NativeWidgetAndroid
// instance.
- base::WeakPtrFactory<NativeWidgetAura> close_widget_factory_;
+ base::WeakPtrFactory<NativeWidgetAndroid> close_widget_factory_;
- DISALLOW_COPY_AND_ASSIGN(NativeWidgetAura);
+ DISALLOW_COPY_AND_ASSIGN(NativeWidgetAndroid);
};
} // namespace views
-#endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_AURA_H_
+#endif // UI_VIEWS_WIDGET_ANDROID_NATIVE_WIDGET_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698