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

Side by Side Diff: services/navigation/content_client/browser_main_parts.cc

Issue 2026623002: views/mus: Have explicit ownership of views::WindowManagerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 6 months 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/navigation/content_client/browser_main_parts.h" 5 #include "services/navigation/content_client/browser_main_parts.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "content/public/common/mojo_shell_connection.h" 8 #include "content/public/common/mojo_shell_connection.h"
9 #include "content/shell/browser/shell_browser_context.h" 9 #include "content/shell/browser/shell_browser_context.h"
10 #include "content/shell/browser/shell_net_log.h" 10 #include "content/shell/browser/shell_net_log.h"
11 #include "services/navigation/navigation.h" 11 #include "services/navigation/navigation.h"
12 #include "ui/views/mus/window_manager_connection.h" 12 #include "ui/views/mus/window_manager_connection.h"
13 #include "ui/views/test/test_views_delegate.h" 13 #include "ui/views/test/test_views_delegate.h"
14 14
15 namespace navigation { 15 namespace navigation {
16 16
17 BrowserMainParts::BrowserMainParts( 17 BrowserMainParts::BrowserMainParts(
18 const content::MainFunctionParams& parameters) {} 18 const content::MainFunctionParams& parameters) {}
19 BrowserMainParts::~BrowserMainParts() {} 19 BrowserMainParts::~BrowserMainParts() {}
20 20
21 void BrowserMainParts::ToolkitInitialized() { 21 void BrowserMainParts::ToolkitInitialized() {
22 if (!views::ViewsDelegate::GetInstance()) 22 if (!views::ViewsDelegate::GetInstance())
23 views_delegate_.reset(new views::TestViewsDelegate); 23 views_delegate_.reset(new views::TestViewsDelegate);
24 } 24 }
25 25
26 void BrowserMainParts::PreMainMessageLoopRun() { 26 void BrowserMainParts::PreMainMessageLoopRun() {
27 content::MojoShellConnection* mojo_shell_connection = 27 content::MojoShellConnection* mojo_shell_connection =
28 content::MojoShellConnection::Get(); 28 content::MojoShellConnection::Get();
29 if (mojo_shell_connection) { 29 if (mojo_shell_connection) {
30 views::WindowManagerConnection::Create( 30 window_manager_connection_ = views::WindowManagerConnection::Create(
31 mojo_shell_connection->GetConnector(), 31 mojo_shell_connection->GetConnector(),
32 mojo_shell_connection->GetIdentity()); 32 mojo_shell_connection->GetIdentity());
33 } 33 }
34 net_log_.reset(new content::ShellNetLog("ash_shell")); 34 net_log_.reset(new content::ShellNetLog("ash_shell"));
35 browser_context_.reset( 35 browser_context_.reset(
36 new content::ShellBrowserContext(false, net_log_.get())); 36 new content::ShellBrowserContext(false, net_log_.get()));
37 navigation_->Init(mojo_shell_connection->GetConnector(), browser_context()); 37 navigation_->Init(mojo_shell_connection->GetConnector(), browser_context());
38 } 38 }
39 39
40 void BrowserMainParts::PostMainMessageLoopRun() { 40 void BrowserMainParts::PostMainMessageLoopRun() {
41 views_delegate_.reset(); 41 views_delegate_.reset();
42 browser_context_.reset(); 42 browser_context_.reset();
43 } 43 }
44 44
45 bool BrowserMainParts::MainMessageLoopRun(int* result_code) { 45 bool BrowserMainParts::MainMessageLoopRun(int* result_code) {
46 base::MessageLoop::current()->Run(); 46 base::MessageLoop::current()->Run();
47 return true; 47 return true;
48 } 48 }
49 49
50 } // namespace navigation 50 } // namespace navigation
OLDNEW
« no previous file with comments | « services/navigation/content_client/browser_main_parts.h ('k') | ui/views/mus/views_mus_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698