mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Windows: Switch to aura/views architecture for content window creation (issue #180).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1542 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -30,6 +30,13 @@
|
||||
#include "chrome/browser/printing/print_dialog_gtk.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA)
|
||||
#include "ui/aura/env.h"
|
||||
#include "ui/gfx/screen.h"
|
||||
#include "ui/views/test/desktop_test_views_delegate.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_screen.h"
|
||||
#endif // defined(USE_AURA)
|
||||
|
||||
CefBrowserMainParts::CefBrowserMainParts(
|
||||
const content::MainFunctionParams& parameters)
|
||||
: BrowserMainParts(),
|
||||
@ -47,6 +54,15 @@ void CefBrowserMainParts::PreMainMessageLoopStart() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserMainParts::ToolkitInitialized() {
|
||||
#if defined(USE_AURA)
|
||||
aura::Env::CreateInstance();
|
||||
|
||||
DCHECK(!views::ViewsDelegate::views_delegate);
|
||||
new views::DesktopTestViewsDelegate;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CefBrowserMainParts::PostMainMessageLoopStart() {
|
||||
// Don't use the default WebUI controller factory because is conflicts with
|
||||
// CEF's internal handling of "chrome://tracing".
|
||||
@ -67,6 +83,11 @@ int CefBrowserMainParts::PreCreateThreads() {
|
||||
// before the IO thread is started.
|
||||
content::GpuDataManager::GetInstance();
|
||||
|
||||
#if defined(USE_AURA)
|
||||
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
|
||||
views::CreateDesktopScreen());
|
||||
#endif
|
||||
|
||||
// Initialize user preferences.
|
||||
pref_store_ = new CefBrowserPrefStore();
|
||||
pref_store_->SetInitializationCompleted();
|
||||
@ -138,6 +159,11 @@ void CefBrowserMainParts::PostDestroyThreads() {
|
||||
proxy_v8_isolate_->Dispose();
|
||||
}
|
||||
|
||||
#if defined(USE_AURA)
|
||||
aura::Env::DeleteInstance();
|
||||
delete views::ViewsDelegate::views_delegate;
|
||||
#endif
|
||||
|
||||
PlatformCleanup();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user