ChromiumBrowser: flash plugin support, docs updated, cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@9053 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
zbych 2015-10-19 16:47:57 +00:00
parent 32f9baa487
commit e78bd73f33
6 changed files with 35 additions and 12 deletions

View file

@ -33,7 +33,7 @@ void ChromiumBrowser::ChildProcess()
{
CefRefPtr<ClientApp> app(new ClientApp);
#ifdef PLATFORM_LINUX
#ifdef PLATFORM_POSIX
Vector<char *> args = GetArgs();
CefMainArgs main_args(args.GetCount(), &args[0]);
@ -67,7 +67,7 @@ ChromiumBrowser::ChromiumBrowser(): handler(NULL), start_page("about:blank")
{
CefRefPtr<ClientApp> app(new ClientApp);
#ifdef PLATFORM_LINUX
#ifdef PLATFORM_POSIX
Vector<char *> args = GetArgs();
CefMainArgs main_args(args.GetCount(), &args[0]);

View file

@ -12,6 +12,22 @@ void ClientApp::OnBeforeCommandLineProcessing(const CefString& process_type, Cef
//Extra command line switches
command_line->AppendSwitch("enable-media-stream");
command_line->AppendSwitch("no-sandbox");
#ifdef PLATFORM_LINUX
Upp::String fp = Upp::GetExeDirFile("libpepflashplayer.so");
#elif defined(PLATFORM_WIN32)
Upp::String fp = Upp::GetExeDirFile("pepflashplayer.dll");
#else
#error "Unsupported platform"
#endif
if (Upp::FileExists(fp)) command_line->AppendSwitchWithValue("ppapi-flash-path", ~fp);
}

View file

@ -35,19 +35,19 @@ public:
~ClientHandler() { }
Upp::Callback1<Upp::String> & WhenUrlChange;
Upp::Callback2<Upp::String, const Upp::Vector<Upp::Value>&> & WhenMessage;
Upp::Callback & WhenTakeFocus;
Upp::Callback & WhenGotFocus;
Upp::Callback1<bool> & WhenKeyboard;
Upp::Callback3<Upp::String, int, Upp::String> & WhenConsoleMessage;
const Upp::Callback1<Upp::String> & WhenUrlChange;
const Upp::Callback2<Upp::String, const Upp::Vector<Upp::Value>&> & WhenMessage;
const Upp::Callback & WhenTakeFocus;
const Upp::Callback & WhenGotFocus;
const Upp::Callback1<bool> & WhenKeyboard;
const Upp::Callback3<Upp::String, int, Upp::String> & WhenConsoleMessage;
void WhenMessageWrapper(Upp::String name, Upp::Vector<Upp::Value> * par);
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() OVERRIDE { return this; }
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() OVERRIDE { return this; }
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() OVERRIDE { return this; }
// virtual CefRefPtr<CefLoadHandler> GetLoadHandler() OVERRIDE { return this; }
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() OVERRIDE { return this; }
virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() OVERRIDE { return this; }
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() OVERRIDE { return this; }

View file

@ -138,6 +138,9 @@ files. It should look like this:&]
[s0; -|-| zh`-CN.pak&]
[s0; -|-| zh`-TW.pak&]
[s0; &]
[s0;i150;O0; if you need Flash plugin, install google chrome browser
and copy [C libpepflashplayer.so] from [C /opt/google/chrome/PepperFlash]
to the output directory&]
[s0;* &]
[ {{10000F(128)G(128)@1 [s0; [* Building CEF application on Windows]]}}&]
[s0; &]
@ -237,7 +240,11 @@ required files. Your application directory should look like this:&]
[s0; -|-| vi.pak&]
[s0; -|-| zh`-CN.pak&]
[s0; -|-| zh`-TW.pak&]
[s0;* &]
[s0; &]
[s0;i150;O0; if you need flash plugin, install google chrome browser
and copy [C pepflashplayer.dll] from `"[C c:`\Program Files (x86)`\Google`\Chrome`\App
lication`\xxx`\PepperFlash]`" to the output directory&]
[s0; &]
[ {{10000F(128)G(128)@1 [s0; [* Final remarks]]}}&]
[s0;i150;O0; CEF is multiprocess and multithreaded library. Your
application binary file will be executed at least three times

View file

@ -4,8 +4,8 @@ LAYOUT(ChromiumBrowserExampleLayout, 504, 260)
ITEM(Button, Refresh, Tip(t_("Refresh current page")).LeftPosZ(108, 48).TopPosZ(4, 44))
ITEM(EditString, Url, SetFont(StdFontZ(32)).HSizePosZ(160, 160).TopPosZ(4, 44))
ITEM(Button, Go, Tip(t_("Go")).RightPosZ(108, 48).TopPosZ(4, 44))
ITEM(Button, Stop, Tip(t_("Stop")).RightPosZ(56, 48).TopPosZ(4, 44))
ITEM(Button, JSTests, SetLabel(t_("JS Test")).Tip(t_("Javascript test")).RightPosZ(4, 48).TopPosZ(4, 44))
ITEM(ChromiumBrowser, Browser, StartPage("http://ultimatepp.org").HSizePosZ(0, 0).VSizePosZ(52, 0))
ITEM(Button, Stop, Tip(t_("Stop")).RightPosZ(56, 48).TopPosZ(4, 44))
END_LAYOUT

View file

@ -45,7 +45,7 @@ ChromiumBrowserExample::ChromiumBrowserExample()
JSTests.WhenAction = THISBACK(OnJSTests);
//Delayed maximization - workaround of layout problem
SetTimeCallback(100, THISBACK1(Maximize, false));
SetTimeCallback(200, THISBACK1(Maximize, false));
}