Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: third_party/WebKit/public/web/WebView.h

Issue 1918183004: Switch the inheritance of WebView from WebWidget to protected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set webwidget on frame creation instead of view creation Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 class WebViewClient; 62 class WebViewClient;
63 class WebViewScheduler; 63 class WebViewScheduler;
64 struct WebActiveWheelFlingParameters; 64 struct WebActiveWheelFlingParameters;
65 struct WebDeviceEmulationParams; 65 struct WebDeviceEmulationParams;
66 struct WebFloatPoint; 66 struct WebFloatPoint;
67 struct WebMediaPlayerAction; 67 struct WebMediaPlayerAction;
68 struct WebPluginAction; 68 struct WebPluginAction;
69 struct WebPoint; 69 struct WebPoint;
70 struct WebWindowFeatures; 70 struct WebWindowFeatures;
71 71
72 class WebView : public WebWidget { 72 class WebView : protected WebWidget {
73 public: 73 public:
74 BLINK_EXPORT static const double textSizeMultiplierRatio; 74 BLINK_EXPORT static const double textSizeMultiplierRatio;
75 BLINK_EXPORT static const double minTextSizeMultiplier; 75 BLINK_EXPORT static const double minTextSizeMultiplier;
76 BLINK_EXPORT static const double maxTextSizeMultiplier; 76 BLINK_EXPORT static const double maxTextSizeMultiplier;
77 77
78 enum StyleInjectionTarget { 78 enum StyleInjectionTarget {
79 InjectStyleInAllFrames, 79 InjectStyleInAllFrames,
80 InjectStyleInTopFrameOnly 80 InjectStyleInTopFrameOnly
81 }; 81 };
82 82
83 // WebWidget overrides.
84 void close() override {}
dcheng 2016/05/03 09:27:13 I didn't think of this for the WebWidgetClient/Web
lfg 2016/05/03 21:19:43 That does work, but it has the disadvantage of not
dcheng 2016/05/04 04:55:29 I'm OK with it either way. I don't think it's a bi
85 WebSize size() override { return WebSize(); }
86 void resize(const WebSize&) override {}
87 void resizeVisualViewport(const WebSize&) override {}
88 void didEnterFullScreen() override {}
89 void didExitFullScreen() override {}
90 void beginFrame(double lastFrameTimeMonotonic) override {}
91 void updateAllLifecyclePhases() override {}
92 void paint(WebCanvas*, const WebRect& viewPort) override {}
93 void paintIgnoringCompositing(WebCanvas*, const WebRect&) override {}
94 void layoutAndPaintAsync(WebLayoutAndPaintAsyncCallback*) override {}
95 void compositeAndReadbackAsync(WebCompositeAndReadbackAsyncCallback*) overri de {}
96 void themeChanged() override {}
97 WebInputEventResult handleInputEvent(const WebInputEvent&) override { return WebInputEventResult::NotHandled; }
98 void setCursorVisibilityState(bool isVisible) override {}
99 bool hasTouchEventHandlersAt(const WebPoint&) override { return true; }
100 void applyViewportDeltas(
101 const WebFloatSize& visualViewportDelta,
102 const WebFloatSize& layoutViewportDelta,
103 const WebFloatSize& elasticOverscrollDelta,
104 float scaleFactor,
105 float topControlsShownRatioDelta) override {}
106 void mouseCaptureLost() override {}
107 void setFocus(bool) override {}
108 bool setComposition(
109 const WebString& text,
110 const WebVector<WebCompositionUnderline>& underlines,
111 int selectionStart,
112 int selectionEnd) override
113 {
114 return false;
115 }
116 bool confirmComposition() override { return false; }
117 bool confirmComposition(ConfirmCompositionBehavior selectionBehavior) overri de { return false; }
118 bool confirmComposition(const WebString& text) override { return false; }
119 bool compositionRange(size_t* location, size_t* length) override { return fa lse; }
120 WebTextInputInfo textInputInfo() override { return WebTextInputInfo(); }
121 WebTextInputType textInputType() override { return WebTextInputTypeNone; }
122 bool selectionBounds(WebRect& anchor, WebRect& focus) const override { retur n false; }
123 bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const override { return false; }
124 bool isSelectionAnchorFirst() const override { return false; }
125 bool caretOrSelectionRange(size_t* location, size_t* length) override { retu rn false; }
126 void setTextDirection(WebTextDirection) override {}
127 bool isAcceleratedCompositingActive() const override { return false; }
128 bool isWebView() const override { return false; }
129 bool isPagePopup() const override { return false; }
130 void willCloseLayerTreeView() override {}
131 void didAcquirePointerLock() override {}
132 void didNotAcquirePointerLock() override {}
133 void didLosePointerLock() override {}
134 void didChangeWindowResizerRect() override {}
135 WebColor backgroundColor() const override { return 0xFFFFFFFF; /* SK_ColorWH ITE */ }
136 WebPagePopup* pagePopup() const override { return 0; }
137 void updateTopControlsState(WebTopControlsState constraints, WebTopControlsS tate current, bool animate) override {}
83 138
84 // Initialization ------------------------------------------------------ 139 // Initialization ------------------------------------------------------
85 140
86 // Creates a WebView that is NOT yet initialized. You will need to 141 // Creates a WebView that is NOT yet initialized. You will need to
87 // call setMainFrame to finish the initialization. It is valid 142 // call setMainFrame to finish the initialization. It is valid
88 // to pass a null client pointer. 143 // to pass a null client pointer.
89 BLINK_EXPORT static WebView* create(WebViewClient*); 144 BLINK_EXPORT static WebView* create(WebViewClient*);
90 145
91 // After creating a WebView, you should immediately call this method. 146 // After creating a WebView, you should immediately call this method.
92 // You can optionally modify the settings before calling this method. 147 // You can optionally modify the settings before calling this method.
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 // Testing functionality for TestRunner --------------------------------- 536 // Testing functionality for TestRunner ---------------------------------
482 537
483 // Force the webgl context to fail so that webglcontextcreationerror 538 // Force the webgl context to fail so that webglcontextcreationerror
484 // event gets generated/tested. 539 // event gets generated/tested.
485 virtual void forceNextWebGLContextCreationToFail() = 0; 540 virtual void forceNextWebGLContextCreationToFail() = 0;
486 541
487 // Force the drawing buffer used by webgl contexts to fail so that the webgl 542 // Force the drawing buffer used by webgl contexts to fail so that the webgl
488 // context's ability to deal with that failure gracefully can be tested. 543 // context's ability to deal with that failure gracefully can be tested.
489 virtual void forceNextDrawingBufferCreationToFail() = 0; 544 virtual void forceNextDrawingBufferCreationToFail() = 0;
490 545
546 // TODO(lfg): Remove this once the refactor of WebView/WebWidget is
547 // completed.
548 WebWidget* widget() { return this; }
549
491 protected: 550 protected:
492 ~WebView() {} 551 ~WebView() {}
493 }; 552 };
494 553
495 } // namespace blink 554 } // namespace blink
496 555
497 #endif 556 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698