OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "examples/wm_flow/wm/frame_controller.h" | 5 #include "examples/wm_flow/wm/frame_controller.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
10 #include "mojo/services/public/cpp/view_manager/view.h" | 10 #include "mojo/services/public/cpp/view_manager/view.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 DISALLOW_COPY_AND_ASSIGN(FrameEventHandler); | 92 DISALLOW_COPY_AND_ASSIGN(FrameEventHandler); |
93 }; | 93 }; |
94 | 94 |
95 //////////////////////////////////////////////////////////////////////////////// | 95 //////////////////////////////////////////////////////////////////////////////// |
96 // FrameController, public: | 96 // FrameController, public: |
97 | 97 |
98 FrameController::FrameController( | 98 FrameController::FrameController( |
99 mojo::Shell* shell, | 99 mojo::Shell* shell, |
100 mojo::View* view, | 100 mojo::View* view, |
101 mojo::View** app_view, | 101 mojo::View** app_view, |
102 mojo::WindowManagerApp* window_manager_app) | 102 window_manager::WindowManagerApp* window_manager_app) |
103 : view_(view), | 103 : view_(view), |
104 app_view_(mojo::View::Create(view->view_manager())), | 104 app_view_(mojo::View::Create(view->view_manager())), |
105 frame_view_(new views::View), | 105 frame_view_(new views::View), |
106 frame_view_layout_manager_(new LayoutManager(this)), | 106 frame_view_layout_manager_(new LayoutManager(this)), |
107 widget_(new views::Widget), | 107 widget_(new views::Widget), |
108 maximized_(false), | 108 maximized_(false), |
109 window_manager_app_(window_manager_app) { | 109 window_manager_app_(window_manager_app) { |
110 view_->AddChild(app_view_); | 110 view_->AddChild(app_view_); |
111 app_view_->SetVisible(true); | 111 app_view_->SetVisible(true); |
112 view_->AddObserver(this); | 112 view_->AddObserver(this); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 window_manager_app_->focus_controller()->ActivateView(view_); | 148 window_manager_app_->focus_controller()->ActivateView(view_); |
149 } | 149 } |
150 | 150 |
151 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
152 // FrameController, mojo::ViewObserver implementation: | 152 // FrameController, mojo::ViewObserver implementation: |
153 | 153 |
154 void FrameController::OnViewDestroyed(mojo::View* view) { | 154 void FrameController::OnViewDestroyed(mojo::View* view) { |
155 view_->RemoveObserver(this); | 155 view_->RemoveObserver(this); |
156 delete this; | 156 delete this; |
157 } | 157 } |
OLD | NEW |