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

Side by Side Diff: examples/wm_flow/wm/frame_controller.cc

Issue 818583002: Moves Create() off of View and onto ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: merge 2 trunk Created 6 years 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 unified diff | Download patch
« no previous file with comments | « examples/wm_flow/app/app.cc ('k') | examples/wm_flow/wm/wm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/view_manager/public/cpp/view.h" 10 #include "mojo/services/view_manager/public/cpp/view.h"
11 #include "mojo/services/view_manager/public/cpp/view_manager.h"
11 #include "mojo/views/native_widget_mojo.h" 12 #include "mojo/views/native_widget_mojo.h"
12 #include "services/window_manager/capture_controller.h" 13 #include "services/window_manager/capture_controller.h"
13 #include "services/window_manager/window_manager_app.h" 14 #include "services/window_manager/window_manager_app.h"
14 #include "ui/views/background.h" 15 #include "ui/views/background.h"
15 #include "ui/views/controls/button/checkbox.h" 16 #include "ui/views/controls/button/checkbox.h"
16 #include "ui/views/controls/button/label_button.h" 17 #include "ui/views/controls/button/label_button.h"
17 #include "ui/views/layout/layout_manager.h" 18 #include "ui/views/layout/layout_manager.h"
18 #include "ui/views/widget/widget.h" 19 #include "ui/views/widget/widget.h"
19 #include "ui/wm/public/activation_client.h" 20 #include "ui/wm/public/activation_client.h"
20 21
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 109
109 //////////////////////////////////////////////////////////////////////////////// 110 ////////////////////////////////////////////////////////////////////////////////
110 // FrameController, public: 111 // FrameController, public:
111 112
112 FrameController::FrameController( 113 FrameController::FrameController(
113 mojo::Shell* shell, 114 mojo::Shell* shell,
114 mojo::View* view, 115 mojo::View* view,
115 mojo::View** app_view, 116 mojo::View** app_view,
116 window_manager::WindowManagerApp* window_manager_app) 117 window_manager::WindowManagerApp* window_manager_app)
117 : view_(view), 118 : view_(view),
118 app_view_(mojo::View::Create(view->view_manager())), 119 app_view_(view->view_manager()->CreateView()),
119 frame_view_(new views::View), 120 frame_view_(new views::View),
120 frame_view_layout_manager_(new LayoutManager(this)), 121 frame_view_layout_manager_(new LayoutManager(this)),
121 widget_(new views::Widget), 122 widget_(new views::Widget),
122 maximized_(false), 123 maximized_(false),
123 window_manager_app_(window_manager_app) { 124 window_manager_app_(window_manager_app) {
124 view_->AddChild(app_view_); 125 view_->AddChild(app_view_);
125 app_view_->SetVisible(true); 126 app_view_->SetVisible(true);
126 view_->AddObserver(this); 127 view_->AddObserver(this);
127 *app_view = app_view_; 128 *app_view = app_view_;
128 frame_view_->set_background( 129 frame_view_->set_background(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 window_manager_app_->capture_controller()->ReleaseCapture(view_); 168 window_manager_app_->capture_controller()->ReleaseCapture(view_);
168 } 169 }
169 170
170 //////////////////////////////////////////////////////////////////////////////// 171 ////////////////////////////////////////////////////////////////////////////////
171 // FrameController, mojo::ViewObserver implementation: 172 // FrameController, mojo::ViewObserver implementation:
172 173
173 void FrameController::OnViewDestroyed(mojo::View* view) { 174 void FrameController::OnViewDestroyed(mojo::View* view) {
174 view_->RemoveObserver(this); 175 view_->RemoveObserver(this);
175 delete this; 176 delete this;
176 } 177 }
OLDNEW
« no previous file with comments | « examples/wm_flow/app/app.cc ('k') | examples/wm_flow/wm/wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698