electron_inspectable_web_contents_view.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (c) 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE-CHROMIUM file.
  4. #ifndef ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_INSPECTABLE_WEB_CONTENTS_VIEW_H_
  5. #define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_INSPECTABLE_WEB_CONTENTS_VIEW_H_
  6. #import <AppKit/AppKit.h>
  7. #include "base/apple/owned_objc.h"
  8. #include "base/memory/raw_ptr.h"
  9. #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
  10. #include "ui/base/cocoa/base_view.h"
  11. #if !defined(__has_feature) || !__has_feature(objc_arc)
  12. #error "This file requires ARC support."
  13. #endif
  14. namespace electron {
  15. class InspectableWebContentsViewMac;
  16. }
  17. using electron::InspectableWebContentsViewMac;
  18. @interface NSView (WebContentsView)
  19. - (void)setMouseDownCanMoveWindow:(BOOL)can_move;
  20. @end
  21. @interface ElectronInspectableWebContentsView : BaseView <NSWindowDelegate> {
  22. @private
  23. raw_ptr<electron::InspectableWebContentsViewMac> inspectableWebContentsView_;
  24. NSView* __strong fake_view_;
  25. NSWindow* __strong devtools_window_;
  26. BOOL devtools_visible_;
  27. BOOL devtools_docked_;
  28. BOOL devtools_is_first_responder_;
  29. BOOL attached_to_window_;
  30. DevToolsContentsResizingStrategy strategy_;
  31. }
  32. - (instancetype)initWithInspectableWebContentsViewMac:
  33. (InspectableWebContentsViewMac*)view;
  34. - (void)notifyDevToolsFocused;
  35. - (void)setDevToolsVisible:(BOOL)visible activate:(BOOL)activate;
  36. - (BOOL)isDevToolsVisible;
  37. - (BOOL)isDevToolsFocused;
  38. - (void)setIsDocked:(BOOL)docked activate:(BOOL)activate;
  39. - (void)setContentsResizingStrategy:
  40. (const DevToolsContentsResizingStrategy&)strategy;
  41. - (void)setTitle:(NSString*)title;
  42. - (void)redispatchContextMenuEvent:(base::apple::OwnedNSEvent)theEvent;
  43. @end
  44. #endif // ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_INSPECTABLE_WEB_CONTENTS_VIEW_H_