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
3 // found in the LICENSE file.
5 #include "ui/views_content_client/views_content_client_main_parts.h"
7 #include "base/run_loop.h"
8 #include "content/shell/browser/shell_browser_context.h"
9 #include "ui/base/ime/input_method_initializer.h"
10 #include "ui/views/test/desktop_test_views_delegate.h"
14 ViewsContentClientMainParts::ViewsContentClientMainParts(
15 const content::MainFunctionParams
& content_params
,
16 ViewsContentClient
* views_content_client
)
17 : views_content_client_(views_content_client
) {
20 ViewsContentClientMainParts::~ViewsContentClientMainParts() {
23 void ViewsContentClientMainParts::PreMainMessageLoopRun() {
24 ui::InitializeInputMethodForTesting();
25 browser_context_
.reset(new content::ShellBrowserContext(false, NULL
));
26 views_delegate_
.reset(new views::DesktopTestViewsDelegate
);
29 void ViewsContentClientMainParts::PostMainMessageLoopRun() {
30 browser_context_
.reset();
31 views_delegate_
.reset();
34 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code
) {
35 base::RunLoop run_loop
;