WebApp.cpp 895 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include <include/cef_client.h>
  2. #include "WebApp.h"
  3. #include "../WebString.h"
  4. namespace Atomic
  5. {
  6. // These flags must match the Chromium values.
  7. static const char kProcessType[] = "type";
  8. static const char kRendererProcess[] = "renderer";
  9. #if defined(OS_LINUX)
  10. static const char kZygoteProcess[] = "zygote";
  11. #endif
  12. WebApp::WebApp()
  13. {
  14. }
  15. WebApp::ProcessType WebApp::GetProcessType(CefRefPtr<CefCommandLine> command_line)
  16. {
  17. // The command-line flag won't be specified for the browser process.
  18. if (!command_line->HasSwitch(kProcessType))
  19. return BrowserProcess;
  20. String processType;
  21. ConvertCEFString(command_line->GetSwitchValue(kProcessType), processType);
  22. if (processType == kRendererProcess)
  23. return RendererProcess;
  24. #if defined(OS_LINUX)
  25. else if (processType == kZygoteProcess)
  26. return ZygoteProcess;
  27. #endif
  28. return OtherProcess;
  29. }
  30. }