Chromium Code Reviews| Index: ui/views/widget/android/native_widget_android.h |
| diff --git a/ui/views/widget/native_widget_mac.h b/ui/views/widget/android/native_widget_android.h |
| similarity index 66% |
| copy from ui/views/widget/native_widget_mac.h |
| copy to ui/views/widget/android/native_widget_android.h |
| index b2ed6325c54fab9bf9a82cf90f546040e87258a8..27435386ff4afbd01f41f3227cd79c3712dca1b5 100644 |
| --- a/ui/views/widget/native_widget_mac.h |
| +++ b/ui/views/widget/android/native_widget_android.h |
| @@ -1,52 +1,42 @@ |
| -// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
|
mfomitchev
2015/11/04 23:21:14
2015
bshe
2015/11/11 00:38:29
Done.
|
| // 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_MAC_H_ |
| -#define UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
| +#ifndef UI_VIEWS_WIDGET_ANDROID_NATIVE_WIDGET_ANDROID_H_ |
| +#define UI_VIEWS_WIDGET_ANDROID_NATIVE_WIDGET_ANDROID_H_ |
| -#include "ui/gfx/native_widget_types.h" |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "ui/views/widget/native_widget_private.h" |
| -#if defined(__OBJC__) |
| -@class NativeWidgetMacNSWindow; |
| -#else |
| -class NativeWidgetMacNSWindow; |
| -#endif |
| - |
| -namespace views { |
| -namespace test { |
| -class HitTestNativeWidgetMac; |
| -class MockNativeWidgetMac; |
| +namespace aura { |
| +class Window; |
| +class WindowTreeHost; |
| +namespace client { |
| +class DefaultCaptureClient; |
| +class WindowTreeClient; |
| +} |
| } |
| -class BridgedNativeWidget; |
| - |
| -class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { |
| - public: |
| - NativeWidgetMac(internal::NativeWidgetDelegate* delegate); |
| - ~NativeWidgetMac() override; |
| - |
| - // Retrieves the bridge associated with the given NSWindow. Returns null if |
| - // the supplied handle has no associated Widget. |
| - static BridgedNativeWidget* GetBridgeForNativeWindow( |
| - gfx::NativeWindow window); |
| +namespace wm { |
| +class FocusController; |
| +} |
| - // Return true if the delegate's modal type is window-modal. These display as |
| - // a native window "sheet", and have a different lifetime to regular windows. |
| - bool IsWindowModalSheet() const; |
| +namespace gfx { |
| +class Rect; |
| +class Size; |
| +} |
| - // Deletes |bridge_| and informs |delegate_| that the native widget is |
| - // destroyed. |
| - // This is usually called from the NSWindowDelegate. A derived class can |
| - // override this method for an early hook into the native window teardown. |
| - virtual void OnWindowWillClose(); |
| +namespace views { |
| - // Returns the vertical position that sheets should be anchored, in pixels |
| - // from the bottom of the window. |
| - virtual int SheetPositionY(); |
| +class VIEWS_EXPORT NativeWidgetAndroid : public internal::NativeWidgetPrivate { |
| + public: |
| + explicit NativeWidgetAndroid(internal::NativeWidgetDelegate* delegate); |
| + ~NativeWidgetAndroid() override; |
| + aura::WindowTreeHost* host() { return host_.get(); } |
| - // internal::NativeWidgetPrivate: |
| + protected: |
| + // Overridden from internal::NativeWidgetPrivate: |
| void InitNativeWidget(const Widget::InitParams& params) override; |
| NonClientFrameView* CreateNonClientFrameView() override; |
| bool ShouldUseNativeFrame() const override; |
| @@ -70,7 +60,7 @@ class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { |
| ui::InputMethod* GetInputMethod() override; |
| void CenterWindow(const gfx::Size& size) override; |
| void GetWindowPlacement(gfx::Rect* bounds, |
| - ui::WindowShowState* show_state) const override; |
| + ui::WindowShowState* maximized) const override; |
|
sadrul
2015/11/04 19:00:53
|show_state| would make more sense, instead of |ma
bshe
2015/11/11 00:38:29
Done.
|
| bool SetWindowTitle(const base::string16& title) override; |
| void SetWindowIcons(const gfx::ImageSkia& window_icon, |
| const gfx::ImageSkia& app_icon) override; |
| @@ -132,26 +122,16 @@ class VIEWS_EXPORT NativeWidgetMac : public internal::NativeWidgetPrivate { |
| void OnSizeConstraintsChanged() override; |
| void RepostNativeEvent(gfx::NativeEvent native_event) override; |
| - protected: |
| - // Creates the NSWindow that will be passed to the BridgedNativeWidget. |
| - // Called by InitNativeWidget. The return value will be autoreleased. |
| - virtual NativeWidgetMacNSWindow* CreateNSWindow( |
| - const Widget::InitParams& params); |
| - |
| - internal::NativeWidgetDelegate* delegate() { return delegate_; } |
| - |
| private: |
| - friend class test::MockNativeWidgetMac; |
| - friend class test::HitTestNativeWidgetMac; |
| - |
| internal::NativeWidgetDelegate* delegate_; |
| - scoped_ptr<BridgedNativeWidget> bridge_; |
| - |
| - Widget::InitParams::Ownership ownership_; |
| + 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_; |
| - DISALLOW_COPY_AND_ASSIGN(NativeWidgetMac); |
| + DISALLOW_COPY_AND_ASSIGN(NativeWidgetAndroid); |
| }; |
| } // namespace views |
| -#endif // UI_VIEWS_WIDGET_NATIVE_WIDGET_MAC_H_ |
| +#endif // UI_VIEWS_WIDGET_ANDROID_NATIVE_WIDGET_ANDROID_H_ |