OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MASH_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_ | |
6 #define MASH_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "components/mus/public/cpp/window_observer.h" | |
11 #include "ui/compositor/paint_cache.h" | |
12 #include "ui/views/window/custom_frame_view.h" | |
13 | |
14 class MoveLoop; | |
15 | |
16 class NonClientFrameViewImpl : public views::CustomFrameView, | |
17 public mus::WindowObserver { | |
18 public: | |
19 explicit NonClientFrameViewImpl(mus::Window* window); | |
20 ~NonClientFrameViewImpl() override; | |
21 | |
22 private: | |
23 // CustomFrameView: | |
24 gfx::Rect GetBoundsForClientView() const override; | |
25 void OnPaint(gfx::Canvas* canvas) override; | |
26 void PaintChildren(const ui::PaintContext& context) override; | |
27 bool OnMousePressed(const ui::MouseEvent& event) override; | |
28 bool OnMouseDragged(const ui::MouseEvent& event) override; | |
29 void OnMouseReleased(const ui::MouseEvent& event) override; | |
30 void OnMouseCaptureLost() override; | |
31 | |
32 // mus::WindowObserver: | |
33 void OnWindowClientAreaChanged(mus::Window* window, | |
34 const gfx::Insets& old_client_area) override; | |
35 void OnWindowDestroyed(mus::Window* window) override; | |
36 | |
37 private: | |
38 bool StartMoveLoopIfNecessary(const ui::Event& event); | |
39 void ContinueMove(const ui::Event& event); | |
40 void StopMove(); | |
41 | |
42 mus::Window* window_; | |
43 ui::PaintCache paint_cache_; | |
44 scoped_ptr<MoveLoop> move_loop_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewImpl); | |
47 }; | |
48 | |
49 #endif // MASH_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_ | |
OLD | NEW |