| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 mojo::View** app_view, | 101 mojo::View** app_view, |
| 102 mojo::WindowManagerApp* window_manager_app) | 102 mojo::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 view_->AddObserver(this); | 112 view_->AddObserver(this); |
| 112 *app_view = app_view_; | 113 *app_view = app_view_; |
| 113 frame_view_->set_background( | 114 frame_view_->set_background( |
| 114 views::Background::CreateSolidBackground(SK_ColorBLUE)); | 115 views::Background::CreateSolidBackground(SK_ColorBLUE)); |
| 115 frame_view_->SetLayoutManager(frame_view_layout_manager_); | 116 frame_view_->SetLayoutManager(frame_view_layout_manager_); |
| 116 frame_event_handler_.reset(new FrameEventHandler(this)); | 117 frame_event_handler_.reset(new FrameEventHandler(this)); |
| 117 frame_view_->AddPreTargetHandler(frame_event_handler_.get()); | 118 frame_view_->AddPreTargetHandler(frame_event_handler_.get()); |
| 118 views::Widget::InitParams params( | 119 views::Widget::InitParams params( |
| 119 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 120 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 120 params.native_widget = | 121 params.native_widget = |
| (...skipping 26 matching lines...) Expand all Loading... |
| 147 window_manager_app_->focus_controller()->ActivateView(view_); | 148 window_manager_app_->focus_controller()->ActivateView(view_); |
| 148 } | 149 } |
| 149 | 150 |
| 150 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
| 151 // FrameController, mojo::ViewObserver implementation: | 152 // FrameController, mojo::ViewObserver implementation: |
| 152 | 153 |
| 153 void FrameController::OnViewDestroyed(mojo::View* view) { | 154 void FrameController::OnViewDestroyed(mojo::View* view) { |
| 154 view_->RemoveObserver(this); | 155 view_->RemoveObserver(this); |
| 155 delete this; | 156 delete this; |
| 156 } | 157 } |
| OLD | NEW |