<commit_before>#include "client_app.h"
#include "client_handler.h"
#include "include/wrapper/cef_helpers.h"

ClientApp::ClientApp() {}

void ClientApp::OnContextInitialized() {
    CEF_REQUIRE_UI_THREAD();

    //Creates a broswer window (1 tab in reality is a browser window)

    CefWindowInfo window_info;
    window_info.SetAsWindowless(0, true); //in cef simple(the tutorial), not windowless.
    //TODO: Go through code for cefsimple

    CefBrowserSettings browser_settings; //class
    //creating a singleton instance of ClientHandler
    //All browsers share this ClientHandler instance which is responsible for customizing browser behavior
    //and handling browser-related callbacks
    CefRefPtr<ClientHandler> client_handler(new ClientHandler()); //overriding to deal with other events

    //creating a browser window
    CefBrowserHost::CreateBrowser(
        window_info,
        client_handler.get(),
        "http://www.google.com",
        browser_settings,
        NULL
    );
}

void ClientApp::OnWebKitInitialized() {
    std::string app_code =
                    "var app;"
                    "if (!app)"
                    "    app = {};"
                    "(function() {"
                    "    app.ChangeTextInJS = function(text) {"
                    "        native function ChangeTextInJS();"
                    "        return ChangeTextInJS(text);"
                    "    };"
                    "})();;";<commit_msg>importing V8<commit_after>#include "client_app.h"
#include "client_handler.h"
#include "include/wrapper/cef_helpers.h"
#include "ClientV8ExtensionHandler.h"

ClientApp::ClientApp() {}

void ClientApp::OnContextInitialized() {
    CEF_REQUIRE_UI_THREAD();

    //Creates a broswer window (1 tab in reality is a browser window)

    CefWindowInfo window_info;
    window_info.SetAsWindowless(0, true); //in cef simple(the tutorial), not windowless.

    CefBrowserSettings browser_settings; //class
    //creating a singleton instance of ClientHandler
    //All browsers share this ClientHandler instance which is responsible for customizing browser behavior
    //and handling browser-related callbacks
    CefRefPtr<ClientHandler> client_handler(new ClientHandler()); //overriding to deal with other events

    //creating a browser window
    CefBrowserHost::CreateBrowser(
        window_info,
        client_handler.get(),
        "http://www.google.com",
        browser_settings,
        NULL
    );
}

void ClientApp::OnWebKitInitialized() {
    std::string app_code =
                    "var app;"
                    "if (!app)"
                    "    app = {};"
                    "(function() {"
                    "    app.ChangeTextInJS = function(text) {"
                    "        native function ChangeTextInJS();"
                    "        return ChangeTextInJS(text);"
                    "    };"
                    "})();;";
{'fraction_non_alphanumeric': 0.10257289879931389, 'fraction_numerical': 0.002058319039451115, 'mean_word_length': 2.229235880398671, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7513969', 'n_tokens_mistral': 795, 'n_tokens_neox': 770, 'n_words': 197}