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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
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/views/test/desktop_test_views_delegate.h" 13 #include "ui/views/test/desktop_test_views_delegate.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 ViewsContentClientMainParts::ViewsContentClientMainParts( 17 ViewsContentClientMainParts::ViewsContentClientMainParts(
18 const content::MainFunctionParams& content_params, 18 const content::MainFunctionParams& content_params,
19 ViewsContentClient* views_content_client) 19 ViewsContentClient* views_content_client)
20 : views_content_client_(views_content_client) { 20 : views_content_client_(views_content_client) {
21 } 21 }
22 22
23 ViewsContentClientMainParts::~ViewsContentClientMainParts() { 23 ViewsContentClientMainParts::~ViewsContentClientMainParts() {
24 } 24 }
25 25
26 void ViewsContentClientMainParts::PreMainMessageLoopRun() { 26 void ViewsContentClientMainParts::PreMainMessageLoopRun() {
27 ui::InitializeInputMethodForTesting(); 27 ui::InitializeInputMethodForTesting();
28 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); 28 browser_context_.reset(new content::ShellBrowserContext(false, NULL));
29 29
30 scoped_ptr<views::TestViewsDelegate> test_views_delegate( 30 std::unique_ptr<views::TestViewsDelegate> test_views_delegate(
31 new views::DesktopTestViewsDelegate); 31 new views::DesktopTestViewsDelegate);
32 test_views_delegate->set_context_factory(content::GetContextFactory()); 32 test_views_delegate->set_context_factory(content::GetContextFactory());
33 views_delegate_ = std::move(test_views_delegate); 33 views_delegate_ = std::move(test_views_delegate);
34 } 34 }
35 35
36 void ViewsContentClientMainParts::PostMainMessageLoopRun() { 36 void ViewsContentClientMainParts::PostMainMessageLoopRun() {
37 browser_context_.reset(); 37 browser_context_.reset();
38 views_delegate_.reset(); 38 views_delegate_.reset();
39 } 39 }
40 40
41 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code) { 41 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code) {
42 base::RunLoop run_loop; 42 base::RunLoop run_loop;
43 run_loop.Run(); 43 run_loop.Run();
44 return true; 44 return true;
45 } 45 }
46 46
47 } // namespace ui 47 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698