native_browser_view_views.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include "atom/browser/native_browser_view_views.h"
  5. #include "brightray/browser/inspectable_web_contents_view.h"
  6. #include "ui/gfx/geometry/rect.h"
  7. #include "ui/views/background.h"
  8. #include "ui/views/view.h"
  9. namespace atom {
  10. NativeBrowserViewViews::NativeBrowserViewViews(
  11. brightray::InspectableWebContents* inspectable_web_contents)
  12. : NativeBrowserView(inspectable_web_contents) {}
  13. NativeBrowserViewViews::~NativeBrowserViewViews() {}
  14. void NativeBrowserViewViews::SetAutoResizeFlags(uint8_t flags) {
  15. auto_resize_flags_ = flags;
  16. }
  17. void NativeBrowserViewViews::SetBounds(const gfx::Rect& bounds) {
  18. auto* view = GetInspectableWebContentsView()->GetView();
  19. view->SetBoundsRect(bounds);
  20. }
  21. void NativeBrowserViewViews::SetBackgroundColor(SkColor color) {
  22. auto* view = GetInspectableWebContentsView()->GetView();
  23. view->SetBackground(views::CreateSolidBackground(color));
  24. }
  25. // static
  26. NativeBrowserView* NativeBrowserView::Create(
  27. brightray::InspectableWebContents* inspectable_web_contents) {
  28. return new NativeBrowserViewViews(inspectable_web_contents);
  29. }
  30. } // namespace atom