Home | History | Annotate | Download | only in app
      1 // Copyright (c) 2012 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 "content/public/app/content_main_delegate.h"
      6 
      7 #if !defined(CHROME_MULTIPLE_DLL_CHILD)
      8 #include "content/public/browser/content_browser_client.h"
      9 #endif
     10 
     11 #if !defined(OS_IOS)
     12 #include "content/public/plugin/content_plugin_client.h"
     13 #include "content/public/renderer/content_renderer_client.h"
     14 #include "content/public/utility/content_utility_client.h"
     15 #endif
     16 
     17 namespace content {
     18 
     19 bool ContentMainDelegate::BasicStartupComplete(int* exit_code) {
     20   return false;
     21 }
     22 
     23 int ContentMainDelegate::RunProcess(
     24     const std::string& process_type,
     25     const content::MainFunctionParams& main_function_params) {
     26   return -1;
     27 }
     28 
     29 #if defined(OS_MACOSX) && !defined(OS_IOS)
     30 
     31 bool ContentMainDelegate::ProcessRegistersWithSystemProcess(
     32     const std::string& process_type) {
     33   return false;
     34 }
     35 
     36 bool ContentMainDelegate::ShouldSendMachPort(const std::string& process_type) {
     37   return true;
     38 }
     39 
     40 bool ContentMainDelegate::DelaySandboxInitialization(
     41     const std::string& process_type) {
     42   return false;
     43 }
     44 
     45 #elif defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS)
     46 
     47 void ContentMainDelegate::ZygoteStarting(
     48     ScopedVector<ZygoteForkDelegate>* delegates) {
     49 }
     50 
     51 #endif
     52 
     53 bool ContentMainDelegate::ShouldEnableTerminationOnHeapCorruption() {
     54   return true;
     55 }
     56 
     57 ContentBrowserClient* ContentMainDelegate::CreateContentBrowserClient() {
     58 #if defined(CHROME_MULTIPLE_DLL_CHILD)
     59   return NULL;
     60 #else
     61   return new ContentBrowserClient();
     62 #endif
     63 }
     64 
     65 ContentPluginClient* ContentMainDelegate::CreateContentPluginClient() {
     66 #if defined(OS_IOS) || defined(CHROME_MULTIPLE_DLL_BROWSER)
     67   return NULL;
     68 #else
     69   return new ContentPluginClient();
     70 #endif
     71 }
     72 
     73 ContentRendererClient* ContentMainDelegate::CreateContentRendererClient() {
     74 #if defined(OS_IOS) || defined(CHROME_MULTIPLE_DLL_BROWSER)
     75   return NULL;
     76 #else
     77   return new ContentRendererClient();
     78 #endif
     79 }
     80 
     81 ContentUtilityClient* ContentMainDelegate::CreateContentUtilityClient() {
     82 #if defined(OS_IOS) || defined(CHROME_MULTIPLE_DLL_BROWSER)
     83   return NULL;
     84 #else
     85   return new ContentUtilityClient();
     86 #endif
     87 }
     88 
     89 }  // namespace content
     90