native_browser_view.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 <vector>
  7. #include "atom/common/draggable_region.h"
  8. #include "base/macros.h"
  9. #include "content/public/browser/web_contents.h"
  10. #include "third_party/skia/include/core/SkColor.h"
  11. namespace gfx {
  12. class Rect;
  13. }
  14. namespace atom {
  15. enum AutoResizeFlags {
  16. kAutoResizeWidth = 0x1,
  17. kAutoResizeHeight = 0x2,
  18. };
  19. class InspectableWebContents;
  20. class InspectableWebContentsView;
  21. class NativeBrowserView {
  22. public:
  23. virtual ~NativeBrowserView();
  24. static NativeBrowserView* Create(
  25. InspectableWebContents* inspectable_web_contents);
  26. InspectableWebContents* GetInspectableWebContents() {
  27. return inspectable_web_contents_;
  28. }
  29. InspectableWebContentsView* GetInspectableWebContentsView();
  30. content::WebContents* GetWebContents();
  31. virtual void SetAutoResizeFlags(uint8_t flags) = 0;
  32. virtual void SetBounds(const gfx::Rect& bounds) = 0;
  33. virtual void SetBackgroundColor(SkColor color) = 0;
  34. // Called when the window needs to update its draggable region.
  35. virtual void UpdateDraggableRegions(
  36. const std::vector<gfx::Rect>& system_drag_exclude_areas) {}
  37. protected:
  38. explicit NativeBrowserView(InspectableWebContents* inspectable_web_contents);
  39. InspectableWebContents* inspectable_web_contents_;
  40. private:
  41. DISALLOW_COPY_AND_ASSIGN(NativeBrowserView);
  42. };
  43. } // namespace atom
  44. #endif // ATOM_BROWSER_NATIVE_BROWSER_VIEW_H_