예제 #1
0
	void BrowserWindow::OnBrowserCreated(CefRefPtr<CefBrowser> browser) {
		REQUIRE_MAIN_THREAD();
		DCHECK(!browser_);
		browser_ = browser;

		delegate_->OnBrowserCreated(browser);

		// cant close here, doesnt work on cefclient
	}
예제 #2
0
	void BrowserWindow::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
		REQUIRE_MAIN_THREAD();
		if (browser_.get()) {
			DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
			browser_ = NULL;
		}

		client_handler_->DetachDelegate();
		client_handler_ = NULL;

		// |this| may be deleted.
		delegate_->OnBrowserWindowDestroyed();
	}
void MainMessageLoopExternalPump::OnScheduleWork(int64 delay_ms) {
  REQUIRE_MAIN_THREAD();

  if (delay_ms == kTimerDelayPlaceholder && IsTimerPending()) {
    // Don't set the maximum timer requested from DoWork() if a timer event is
    // currently pending.
    return;
  }

  KillTimer();

  if (delay_ms <= 0) {
    // Execute the work immediately.
    DoWork();
  } else {
    // Never wait longer than the maximum allowed time.
    if (delay_ms > kMaxTimerDelay)
      delay_ms = kMaxTimerDelay;

    // Results in call to OnTimerTimeout() after the specified delay.
    SetTimer(delay_ms);
  }
}
예제 #4
0
	void BrowserWindow::OnSetDraggableRegions(
		const std::vector<CefDraggableRegion>& regions) {
		REQUIRE_MAIN_THREAD();
		delegate_->OnSetDraggableRegions(regions);
	}
예제 #5
0
	void BrowserWindow::OnSetLoadingState(bool isLoading,
		bool canGoBack,
		bool canGoForward) {
		REQUIRE_MAIN_THREAD();
		delegate_->OnSetLoadingState(isLoading, canGoBack, canGoForward);
	}
예제 #6
0
	void BrowserWindow::OnSetFullscreen(bool fullscreen) {
		REQUIRE_MAIN_THREAD();
		delegate_->OnSetFullscreen(fullscreen);
	}
예제 #7
0
	void BrowserWindow::OnSetTitle(const std::string& title) {
		REQUIRE_MAIN_THREAD();
		delegate_->OnSetTitle(title);
	}
예제 #8
0
	void BrowserWindow::OnSetAddress(const std::string& url) {
		REQUIRE_MAIN_THREAD();
		delegate_->OnSetAddress(url);
	}
예제 #9
0
	void BrowserWindow::OnBrowserClosing(CefRefPtr<CefBrowser> browser) {
		REQUIRE_MAIN_THREAD();
		DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
		is_closing_ = true;
	}
예제 #10
0
	bool BrowserWindow::IsClosing() const {
		REQUIRE_MAIN_THREAD();
		return is_closing_;
	}
예제 #11
0
	CefRefPtr<CefBrowser> BrowserWindow::GetBrowser() const {
		REQUIRE_MAIN_THREAD();
		return browser_;
	}
void MainMessageLoopExternalPump::OnTimerTimeout() {
  REQUIRE_MAIN_THREAD();

  KillTimer();
  DoWork();
}