mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Create 2062 release branch for CEF3.
git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2062@1783 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
39
tests/cefsimple/cefsimple_linux.cpp
Normal file
39
tests/cefsimple/cefsimple_linux.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "cefsimple/simple_app.h"
|
||||
|
||||
// Entry point function for all processes.
|
||||
int main(int argc, char* argv[]) {
|
||||
// Provide CEF with command-line arguments.
|
||||
CefMainArgs main_args(argc, argv);
|
||||
|
||||
// SimpleApp implements application-level callbacks. It will create the first
|
||||
// browser instance in OnContextInitialized() after CEF has initialized.
|
||||
CefRefPtr<SimpleApp> app(new SimpleApp);
|
||||
|
||||
// CEF applications have multiple sub-processes (render, plugin, GPU, etc)
|
||||
// that share the same executable. This function checks the command-line and,
|
||||
// if this is a sub-process, executes the appropriate logic.
|
||||
int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
|
||||
if (exit_code >= 0) {
|
||||
// The sub-process has completed so return here.
|
||||
return exit_code;
|
||||
}
|
||||
|
||||
// Specify CEF global settings here.
|
||||
CefSettings settings;
|
||||
|
||||
// Initialize CEF for the browser process.
|
||||
CefInitialize(main_args, settings, app.get(), NULL);
|
||||
|
||||
// Run the CEF message loop. This will block until CefQuitMessageLoop() is
|
||||
// called.
|
||||
CefRunMessageLoop();
|
||||
|
||||
// Shut down CEF.
|
||||
CefShutdown();
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user