• 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 #ifndef CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_STD_GTK_H_
6 #define CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_STD_GTK_H_
7 #pragma once
8 
9 #include "tests/cefclient/browser/browser_window.h"
10 
11 namespace client {
12 
13 // Represents a native child window hosting a single windowed browser instance.
14 // The methods of this class must be called on the main thread unless otherwise
15 // indicated.
16 class BrowserWindowStdGtk : public BrowserWindow {
17  public:
18   // Constructor may be called on any thread.
19   // |delegate| must outlive this object.
20   BrowserWindowStdGtk(Delegate* delegate, const std::string& startup_url);
21 
22   // Called from RootWindowGtk::CreateRootWindow before CreateBrowser.
23   void set_xdisplay(XDisplay* xdisplay);
24 
25   // BrowserWindow methods.
26   void CreateBrowser(ClientWindowHandle parent_handle,
27                      const CefRect& rect,
28                      const CefBrowserSettings& settings,
29                      CefRefPtr<CefDictionaryValue> extra_info,
30                      CefRefPtr<CefRequestContext> request_context) override;
31   void GetPopupConfig(CefWindowHandle temp_handle,
32                       CefWindowInfo& windowInfo,
33                       CefRefPtr<CefClient>& client,
34                       CefBrowserSettings& settings) override;
35   void ShowPopup(ClientWindowHandle parent_handle,
36                  int x,
37                  int y,
38                  size_t width,
39                  size_t height) override;
40   void Show() override;
41   void Hide() override;
42   void SetBounds(int x, int y, size_t width, size_t height) override;
43   void SetFocus(bool focus) override;
44   ClientWindowHandle GetWindowHandle() const override;
45 
46  private:
47   XDisplay* xdisplay_;
48 
49   DISALLOW_COPY_AND_ASSIGN(BrowserWindowStdGtk);
50 };
51 
52 }  // namespace client
53 
54 #endif  // CEF_TESTS_CEFCLIENT_BROWSER_BROWSER_WINDOW_STD_GTK_H_
55