2015-01-30 19:07:13 +01:00
|
|
|
// Copyright (c) 2015 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.
|
|
|
|
|
2016-11-18 00:52:42 +01:00
|
|
|
#include "tests/cefclient/browser/root_window.h"
|
2015-01-30 19:07:13 +01:00
|
|
|
|
2016-11-18 00:52:42 +01:00
|
|
|
#include "tests/cefclient/browser/main_context.h"
|
|
|
|
#include "tests/cefclient/browser/root_window_manager.h"
|
2015-01-30 19:07:13 +01:00
|
|
|
|
|
|
|
namespace client {
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
RootWindowConfig::RootWindowConfig()
|
|
|
|
: with_controls(true),
|
|
|
|
with_osr(false),
|
|
|
|
with_extension(false),
|
|
|
|
initially_hidden(false),
|
|
|
|
url(MainContext::Get()->GetMainURL()) {}
|
|
|
|
|
|
|
|
RootWindow::RootWindow() : delegate_(NULL) {}
|
|
|
|
|
|
|
|
RootWindow::~RootWindow() {}
|
|
|
|
|
2015-01-30 19:07:13 +01:00
|
|
|
// static
|
2015-01-30 19:55:55 +01:00
|
|
|
scoped_refptr<RootWindow> RootWindow::GetForBrowser(int browser_id) {
|
2015-01-30 19:07:13 +01:00
|
|
|
return MainContext::Get()->GetRootWindowManager()->GetWindowForBrowser(
|
|
|
|
browser_id);
|
|
|
|
}
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
void RootWindow::OnExtensionsChanged(const ExtensionSet& extensions) {
|
|
|
|
REQUIRE_MAIN_THREAD();
|
|
|
|
DCHECK(delegate_);
|
|
|
|
DCHECK(!WithExtension());
|
|
|
|
|
|
|
|
if (extensions.empty())
|
|
|
|
return;
|
|
|
|
|
|
|
|
ExtensionSet::const_iterator it = extensions.begin();
|
|
|
|
for (; it != extensions.end(); ++it) {
|
|
|
|
delegate_->CreateExtensionWindow(*it, CefRect(), NULL, base::Closure(),
|
|
|
|
WithWindowlessRendering());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-30 19:07:13 +01:00
|
|
|
} // namespace client
|