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

Unified Diff: services/window_manager/main.cc

Issue 815003002: Nukes ViewManager arg from ViewManagerDelegate::OnEmbed (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: format 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 side-by-side diff with in-line comments
Download patch
Index: services/window_manager/main.cc
diff --git a/services/window_manager/main.cc b/services/window_manager/main.cc
index 893657f68061c26dfa16dbeb411e1ceace6c58a3..1d069e0abf7167c15f887baefc6d80795d50d380 100644
--- a/services/window_manager/main.cc
+++ b/services/window_manager/main.cc
@@ -27,9 +27,7 @@ class DefaultWindowManager : public mojo::ApplicationDelegate,
public WindowManagerDelegate {
public:
DefaultWindowManager()
- : window_manager_app_(new WindowManagerApp(this, this)),
- view_manager_(NULL),
- root_(NULL) {}
+ : window_manager_app_(new WindowManagerApp(this, this)), root_(nullptr) {}
~DefaultWindowManager() override {}
private:
@@ -45,11 +43,9 @@ class DefaultWindowManager : public mojo::ApplicationDelegate,
}
// Overridden from ViewManagerDelegate:
- void OnEmbed(ViewManager* view_manager,
- View* root,
+ void OnEmbed(View* root,
mojo::ServiceProviderImpl* exported_services,
scoped_ptr<mojo::ServiceProvider> imported_services) override {
- view_manager_ = view_manager;
root_ = root;
}
void OnViewManagerDisconnected(ViewManager* view_manager) override {}
@@ -58,7 +54,7 @@ class DefaultWindowManager : public mojo::ApplicationDelegate,
void Embed(
const mojo::String& url,
mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) override {
- View* view = View::Create(view_manager_);
+ View* view = View::Create(root_->view_manager());
root_->AddChild(view);
view->SetVisible(true);
view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>(
@@ -67,7 +63,6 @@ class DefaultWindowManager : public mojo::ApplicationDelegate,
scoped_ptr<WindowManagerApp> window_manager_app_;
- ViewManager* view_manager_;
View* root_;
MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager);
« no previous file with comments | « mojo/services/view_manager/public/cpp/view_manager_delegate.h ('k') | services/window_manager/window_manager_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698