2012-12-30 12:17:49 +01:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that can
|
|
|
|
// be found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "libcef/browser/browser_info.h"
|
|
|
|
#include "ipc/ipc_message.h"
|
|
|
|
|
|
|
|
CefBrowserInfo::CefBrowserInfo(int browser_id, bool is_popup)
|
|
|
|
: browser_id_(browser_id),
|
|
|
|
is_popup_(is_popup),
|
2013-04-16 21:23:00 +02:00
|
|
|
is_window_rendering_disabled_(false),
|
2012-12-30 12:17:49 +01:00
|
|
|
render_process_id_(MSG_ROUTING_NONE),
|
|
|
|
render_view_id_(MSG_ROUTING_NONE) {
|
|
|
|
DCHECK_GT(browser_id, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefBrowserInfo::~CefBrowserInfo() {
|
|
|
|
}
|
|
|
|
|
2013-04-16 21:23:00 +02:00
|
|
|
void CefBrowserInfo::set_window_rendering_disabled(bool disabled) {
|
|
|
|
is_window_rendering_disabled_ = disabled;
|
|
|
|
}
|
|
|
|
|
2012-12-30 12:17:49 +01:00
|
|
|
void CefBrowserInfo::set_render_ids(
|
|
|
|
int render_process_id, int render_view_id) {
|
|
|
|
base::AutoLock lock_scope(lock_);
|
|
|
|
render_process_id_ = render_process_id;
|
|
|
|
render_view_id_ = render_view_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefBrowserInfo::is_render_id_match(
|
|
|
|
int render_process_id, int render_view_id) {
|
|
|
|
base::AutoLock lock_scope(lock_);
|
|
|
|
if (render_process_id != render_process_id_)
|
|
|
|
return false;
|
|
|
|
return (render_view_id == 0 || render_view_id == render_view_id_);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowserHostImpl> CefBrowserInfo::browser() {
|
|
|
|
base::AutoLock lock_scope(lock_);
|
|
|
|
return browser_;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserInfo::set_browser(CefRefPtr<CefBrowserHostImpl> browser) {
|
|
|
|
base::AutoLock lock_scope(lock_);
|
|
|
|
browser_ = browser;
|
|
|
|
}
|