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

Side by Side Diff: ui/views_content_client/views_content_client_main_parts.cc

Issue 1903393003: Initialize Material Design in views_examples_with_content_exe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add owners whynot Created 4 years, 8 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
« no previous file with comments | « ui/views_content_client/OWNERS ('k') | no next file » | 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 "ui/views_content_client/views_content_client_main_parts.h" 5 #include "ui/views_content_client/views_content_client_main_parts.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/public/browser/context_factory.h" 10 #include "content/public/browser/context_factory.h"
11 #include "content/shell/browser/shell_browser_context.h" 11 #include "content/shell/browser/shell_browser_context.h"
12 #include "ui/base/ime/input_method_initializer.h" 12 #include "ui/base/ime/input_method_initializer.h"
13 #include "ui/base/material_design/material_design_controller.h"
13 #include "ui/views/test/desktop_test_views_delegate.h" 14 #include "ui/views/test/desktop_test_views_delegate.h"
14 15
15 namespace ui { 16 namespace ui {
16 17
17 ViewsContentClientMainParts::ViewsContentClientMainParts( 18 ViewsContentClientMainParts::ViewsContentClientMainParts(
18 const content::MainFunctionParams& content_params, 19 const content::MainFunctionParams& content_params,
19 ViewsContentClient* views_content_client) 20 ViewsContentClient* views_content_client)
20 : views_content_client_(views_content_client) { 21 : views_content_client_(views_content_client) {
21 } 22 }
22 23
23 ViewsContentClientMainParts::~ViewsContentClientMainParts() { 24 ViewsContentClientMainParts::~ViewsContentClientMainParts() {
24 } 25 }
25 26
26 void ViewsContentClientMainParts::PreMainMessageLoopRun() { 27 void ViewsContentClientMainParts::PreMainMessageLoopRun() {
28 ui::MaterialDesignController::Initialize();
27 ui::InitializeInputMethodForTesting(); 29 ui::InitializeInputMethodForTesting();
28 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); 30 browser_context_.reset(new content::ShellBrowserContext(false, NULL));
29 31
30 std::unique_ptr<views::TestViewsDelegate> test_views_delegate( 32 std::unique_ptr<views::TestViewsDelegate> test_views_delegate(
31 new views::DesktopTestViewsDelegate); 33 new views::DesktopTestViewsDelegate);
32 test_views_delegate->set_context_factory(content::GetContextFactory()); 34 test_views_delegate->set_context_factory(content::GetContextFactory());
33 views_delegate_ = std::move(test_views_delegate); 35 views_delegate_ = std::move(test_views_delegate);
34 } 36 }
35 37
36 void ViewsContentClientMainParts::PostMainMessageLoopRun() { 38 void ViewsContentClientMainParts::PostMainMessageLoopRun() {
37 browser_context_.reset(); 39 browser_context_.reset();
38 views_delegate_.reset(); 40 views_delegate_.reset();
39 } 41 }
40 42
41 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code) { 43 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code) {
42 base::RunLoop run_loop; 44 base::RunLoop run_loop;
43 run_loop.Run(); 45 run_loop.Run();
44 return true; 46 return true;
45 } 47 }
46 48
47 } // namespace ui 49 } // namespace ui
OLDNEW
« no previous file with comments | « ui/views_content_client/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698