| OLD | NEW |
| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 void ViewsContentClientMainParts::PreMainMessageLoopRun() { | 27 void ViewsContentClientMainParts::PreMainMessageLoopRun() { |
| 28 ui::MaterialDesignController::Initialize(); | 28 ui::MaterialDesignController::Initialize(); |
| 29 ui::InitializeInputMethodForTesting(); | 29 ui::InitializeInputMethodForTesting(); |
| 30 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); | 30 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); |
| 31 | 31 |
| 32 std::unique_ptr<views::TestViewsDelegate> test_views_delegate( | 32 std::unique_ptr<views::TestViewsDelegate> test_views_delegate( |
| 33 new views::DesktopTestViewsDelegate); | 33 new views::DesktopTestViewsDelegate); |
| 34 test_views_delegate->set_context_factory(content::GetContextFactory()); | 34 test_views_delegate->set_context_factory(content::GetContextFactory()); |
| 35 test_views_delegate->set_context_factory_private( |
| 36 content::GetContextFactoryPrivate()); |
| 35 views_delegate_ = std::move(test_views_delegate); | 37 views_delegate_ = std::move(test_views_delegate); |
| 36 } | 38 } |
| 37 | 39 |
| 38 void ViewsContentClientMainParts::PostMainMessageLoopRun() { | 40 void ViewsContentClientMainParts::PostMainMessageLoopRun() { |
| 39 browser_context_.reset(); | 41 browser_context_.reset(); |
| 40 views_delegate_.reset(); | 42 views_delegate_.reset(); |
| 41 } | 43 } |
| 42 | 44 |
| 43 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code) { | 45 bool ViewsContentClientMainParts::MainMessageLoopRun(int* result_code) { |
| 44 base::RunLoop run_loop; | 46 base::RunLoop run_loop; |
| 45 run_loop.Run(); | 47 run_loop.Run(); |
| 46 return true; | 48 return true; |
| 47 } | 49 } |
| 48 | 50 |
| 49 } // namespace ui | 51 } // namespace ui |
| OLD | NEW |