OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "ui/views_content_client/views_content_client_main_parts.h" |
| 6 |
| 7 #include "base/path_service.h" |
| 8 #include "content/shell/browser/shell_browser_context.h" |
| 9 #include "content/public/common/content_paths.h" |
| 10 #include "ui/views_content_client/views_content_client.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 namespace { |
| 15 |
| 16 class ViewsContentClientMainPartsMac : public ViewsContentClientMainParts { |
| 17 public: |
| 18 ViewsContentClientMainPartsMac( |
| 19 const content::MainFunctionParams& content_params, |
| 20 ViewsContentClient* views_content_client); |
| 21 virtual ~ViewsContentClientMainPartsMac() {} |
| 22 |
| 23 // content::BrowserMainParts: |
| 24 virtual void ToolkitInitialized() OVERRIDE; |
| 25 virtual void PreMainMessageLoopRun() OVERRIDE; |
| 26 |
| 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsMac); |
| 29 }; |
| 30 |
| 31 ViewsContentClientMainPartsMac::ViewsContentClientMainPartsMac( |
| 32 const content::MainFunctionParams& content_params, |
| 33 ViewsContentClient* views_content_client) |
| 34 : ViewsContentClientMainParts(content_params, views_content_client) { |
| 35 // Cache the child process path to avoid triggering an AssertIOAllowed. |
| 36 base::FilePath child_process_exe; |
| 37 PathService::Get(content::CHILD_PROCESS_EXE, &child_process_exe); |
| 38 } |
| 39 |
| 40 void ViewsContentClientMainPartsMac::ToolkitInitialized() { |
| 41 } |
| 42 |
| 43 void ViewsContentClientMainPartsMac::PreMainMessageLoopRun() { |
| 44 ViewsContentClientMainParts::PreMainMessageLoopRun(); |
| 45 views_content_client()->task().Run(browser_context(), NULL); |
| 46 } |
| 47 |
| 48 } // namespace |
| 49 |
| 50 // static |
| 51 ViewsContentClientMainParts* ViewsContentClientMainParts::Create( |
| 52 const content::MainFunctionParams& content_params, |
| 53 ViewsContentClient* views_content_client) { |
| 54 return |
| 55 new ViewsContentClientMainPartsMac(content_params, views_content_client); |
| 56 } |
| 57 |
| 58 } // namespace ui |
OLD | NEW |