native_browser_view.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright (c) 2017 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_NATIVE_BROWSER_VIEW_H_
  5. #define ATOM_BROWSER_NATIVE_BROWSER_VIEW_H_
  6. #include "base/macros.h"
  7. #include "third_party/skia/include/core/SkColor.h"
  8. namespace brightray {
  9. class InspectableWebContentsView;
  10. }
  11. namespace gfx {
  12. class Rect;
  13. }
  14. namespace atom {
  15. namespace api {
  16. class WebContents;
  17. }
  18. enum AutoResizeFlags {
  19. kAutoResizeWidth = 0x1,
  20. kAutoResizeHeight = 0x2,
  21. };
  22. class NativeBrowserView {
  23. public:
  24. virtual ~NativeBrowserView();
  25. static NativeBrowserView* Create(
  26. brightray::InspectableWebContentsView* web_contents_view);
  27. brightray::InspectableWebContentsView* GetInspectableWebContentsView() {
  28. return web_contents_view_;
  29. }
  30. virtual void SetAutoResizeFlags(uint8_t flags) = 0;
  31. virtual void SetBounds(const gfx::Rect& bounds) = 0;
  32. virtual void SetBackgroundColor(SkColor color) = 0;
  33. protected:
  34. explicit NativeBrowserView(
  35. brightray::InspectableWebContentsView* web_contents_view);
  36. brightray::InspectableWebContentsView* web_contents_view_;
  37. private:
  38. DISALLOW_COPY_AND_ASSIGN(NativeBrowserView);
  39. };
  40. } // namespace atom
  41. #endif // ATOM_BROWSER_NATIVE_BROWSER_VIEW_H_