WebPageProxy* WebInspectorProxy::platformCreateInspectorPage() { ASSERT(m_page); #ifdef HAVE_ECORE_X const char* engine = "opengl_x11"; m_inspectorWindow = ecore_evas_new(engine, 0, 0, initialWindowWidth, initialWindowHeight, 0); // Gracefully fall back to software if evas_gl engine is not available. if (!m_inspectorWindow) #endif m_inspectorWindow = ecore_evas_new(0, 0, 0, initialWindowWidth, initialWindowHeight, 0); if (!m_inspectorWindow) return 0; WKContextRef wkContext = toAPI(page()->process()->context()); WKPageGroupRef wkPageGroup = toAPI(inspectorPageGroup()); m_inspectorView = EWKViewCreate(wkContext, wkPageGroup, ecore_evas_get(m_inspectorWindow), /* smart */ 0); WKViewRef wkView = EWKViewGetWKView(m_inspectorView); WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(TEST_THEME_DIR "/default.edj")); WKViewSetThemePath(wkView, wkTheme.get()); WKPreferencesRef wkPreferences = WKPageGroupGetPreferences(wkPageGroup); WKPreferencesSetFileAccessFromFileURLsAllowed(wkPreferences, true); return toImpl(WKViewGetPage(wkView)); }
WebPageProxy* WebInspectorProxy::platformCreateInspectorPage() { ASSERT(m_inspectedPage); #ifdef HAVE_ECORE_X const char* engine = "opengl_x11"; m_inspectorWindow = ecore_evas_new(engine, 0, 0, initialWindowWidth, initialWindowHeight, 0); // Gracefully fall back to software if evas_gl engine is not available. if (!m_inspectorWindow) #endif m_inspectorWindow = ecore_evas_new(0, 0, 0, initialWindowWidth, initialWindowHeight, 0); if (!m_inspectorWindow) return 0; WKContextRef wkContext = toAPI(&inspectorProcessPool()); WKRetainPtr<WKStringRef> wkGroupIdentifier = adoptWK(WKStringCreateWithUTF8CString(inspectorPageGroupIdentifier().utf8().data())); WKPageGroupRef wkPageGroup = WKPageGroupCreateWithIdentifier(wkGroupIdentifier.get()); WKRetainPtr<WKPageConfigurationRef> wkPageConfiguration = adoptWK(WKPageConfigurationCreate()); WKPageConfigurationSetContext(wkPageConfiguration.get(), wkContext); WKPageConfigurationSetPageGroup(wkPageConfiguration.get(), wkPageGroup); m_inspectorView = EWKViewCreate(wkContext, wkPageConfiguration.get(), ecore_evas_get(m_inspectorWindow), /* smart */ 0); WKViewRef wkView = EWKViewGetWKView(m_inspectorView); WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(DEFAULT_THEME_DIR "/default.edj")); WKViewSetThemePath(wkView, wkTheme.get()); WKPreferencesRef wkPreferences = WKPageGroupGetPreferences(wkPageGroup); WKPreferencesSetFileAccessFromFileURLsAllowed(wkPreferences, true); WKPreferencesSetJavaScriptRuntimeFlags(wkPreferences, 0); return toImpl(WKViewGetPage(wkView)); }
PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef) { m_window = initEcoreEvas(); m_view = EWKViewCreate(contextRef, pageGroupRef, ecore_evas_get(m_window), /* smart */ 0); WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(TEST_THEME_DIR "/default.edj")); WKViewSetThemePath(EWKViewGetWKView(m_view), wkTheme.get()); evas_object_smart_callback_add(m_view, "webprocess,crashed", onWebProcessCrashed, 0); resizeTo(600, 800); }
PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKPageRef /* relatedPage */, WKDictionaryRef options) : m_options(options) { WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout")); m_usingFixedLayout = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false; m_window = initEcoreEvas(); m_view = EWKViewCreate(context, pageGroup, ecore_evas_get(m_window), /* smart */ 0); WKPageSetUseFixedLayout(WKViewGetPage(EWKViewGetWKView(m_view)), m_usingFixedLayout); if (m_usingFixedLayout) resizeTo(800, 600); ewk_view_theme_set(m_view, TEST_THEME_DIR "/default.edj"); m_windowIsKey = false; evas_object_show(m_view); }
PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const TestOptions& options) : m_options(options) { WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout")); m_usingFixedLayout = options.useFixedLayout; m_window = initEcoreEvas(); WKContextRef context = WKPageConfigurationGetContext(configuration); m_view = EWKViewCreate(context, configuration, ecore_evas_get(m_window), /* smart */ 0); WKPageSetUseFixedLayout(WKViewGetPage(EWKViewGetWKView(m_view)), m_usingFixedLayout); if (m_usingFixedLayout) resizeTo(800, 600); ewk_view_theme_set(m_view, DEFAULT_THEME_DIR "/default.edj"); m_windowIsKey = false; evas_object_show(m_view); }