• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 
5 #include "tests/cefclient/browser/root_window.h"
6 
7 #include "tests/cefclient/browser/main_context.h"
8 #include "tests/cefclient/browser/root_window_manager.h"
9 
10 namespace client {
11 
RootWindowConfig()12 RootWindowConfig::RootWindowConfig()
13     : always_on_top(false),
14       with_controls(true),
15       with_osr(false),
16       with_extension(false),
17       initially_hidden(false),
18       url(MainContext::Get()->GetMainURL()) {}
19 
RootWindow()20 RootWindow::RootWindow() : delegate_(nullptr) {}
21 
~RootWindow()22 RootWindow::~RootWindow() {}
23 
24 // static
GetForBrowser(int browser_id)25 scoped_refptr<RootWindow> RootWindow::GetForBrowser(int browser_id) {
26   return MainContext::Get()->GetRootWindowManager()->GetWindowForBrowser(
27       browser_id);
28 }
29 
OnExtensionsChanged(const ExtensionSet & extensions)30 void RootWindow::OnExtensionsChanged(const ExtensionSet& extensions) {
31   REQUIRE_MAIN_THREAD();
32   DCHECK(delegate_);
33   DCHECK(!WithExtension());
34 
35   if (extensions.empty())
36     return;
37 
38   ExtensionSet::const_iterator it = extensions.begin();
39   for (; it != extensions.end(); ++it) {
40     delegate_->CreateExtensionWindow(*it, CefRect(), nullptr, base::Closure(),
41                                      WithWindowlessRendering());
42   }
43 }
44 
45 }  // namespace client
46