mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Create 2272 release branch for CEF3.
git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/2272@1993 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
48
tests/cefsimple/simple_app.cc
Normal file
48
tests/cefsimple/simple_app.cc
Normal file
@@ -0,0 +1,48 @@
|
||||
// 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"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "cefsimple/simple_handler.h"
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/cef_command_line.h"
|
||||
#include "include/wrapper/cef_helpers.h"
|
||||
|
||||
SimpleApp::SimpleApp() {
|
||||
}
|
||||
|
||||
void SimpleApp::OnContextInitialized() {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
// Information used when creating the native window.
|
||||
CefWindowInfo window_info;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// On Windows we need to specify certain flags that will be passed to
|
||||
// CreateWindowEx().
|
||||
window_info.SetAsPopup(NULL, "cefsimple");
|
||||
#endif
|
||||
|
||||
// SimpleHandler implements browser-level callbacks.
|
||||
CefRefPtr<SimpleHandler> handler(new SimpleHandler());
|
||||
|
||||
// Specify CEF browser settings here.
|
||||
CefBrowserSettings browser_settings;
|
||||
|
||||
std::string url;
|
||||
|
||||
// Check if a "--url=" value was provided via the command-line. If so, use
|
||||
// that instead of the default URL.
|
||||
CefRefPtr<CefCommandLine> command_line =
|
||||
CefCommandLine::GetGlobalCommandLine();
|
||||
url = command_line->GetSwitchValue("url");
|
||||
if (url.empty())
|
||||
url = "http://www.google.com";
|
||||
|
||||
// Create the first browser window.
|
||||
CefBrowserHost::CreateBrowser(window_info, handler.get(), url,
|
||||
browser_settings, NULL);
|
||||
}
|
Reference in New Issue
Block a user