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

Unified Diff: third_party/WebKit/Source/core/frame/FrameletView.cpp

Issue 1602663003: Framelet Prototype 2016 using Mojo IPC Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Disabled oilpan Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameletView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameletView.cpp b/third_party/WebKit/Source/core/frame/FrameletView.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3a227c0df8e3668fbbd9805d85c04cced4355552
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/FrameletView.cpp
@@ -0,0 +1,104 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/frame/FrameletView.h"
+
+#include "core/events/Event.h"
+#include "core/frame/Framelet.h"
+#include "core/html/HTMLFrameOwnerElement.h"
+#include "core/layout/LayoutPart.h"
+
+namespace blink {
+
+FrameletView::FrameletView(Framelet* framelet)
+ : m_framelet(framelet)
+{
+ ASSERT(framelet);
+}
+
+FrameletView::~FrameletView()
+{
+}
+
+PassRefPtrWillBeRawPtr<FrameletView> FrameletView::create(Framelet* framelet)
+{
+ RefPtrWillBeRawPtr<FrameletView> view = adoptRefWillBeNoop(new FrameletView(framelet));
+ view->show();
+ return view.release();
+}
+
+void FrameletView::dispose()
+{
+ HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(m_framelet->owner());
+ if (ownerElement && ownerElement->ownedWidget() == this)
+ ownerElement->setWidget(nullptr);
+}
+
+void FrameletView::frameRectsChanged()
+{
+ m_framelet->frameRectsChanged(frameRect());
+}
+
+void FrameletView::hide()
+{
+ setSelfVisible(false);
+ m_framelet->updateVisibility(false);
+ Widget::hide();
+}
+
+void FrameletView::invalidateRect(const IntRect& rect)
+{
+ LayoutPart* layoutObject = m_framelet->ownerLayoutObject();
+ if (!layoutObject)
+ return;
+
+ LayoutRect repaintRect(rect);
+ repaintRect.move(layoutObject->borderLeft() + layoutObject->paddingLeft(),
+ layoutObject->borderTop() + layoutObject->paddingTop());
+ layoutObject->invalidatePaintRectangle(repaintRect);
+}
+
+void FrameletView::setFocus(bool focused, WebFocusType focusType)
+{
+ m_framelet->updateFocus(focused, focusType);
+}
+
+void FrameletView::setFrameRect(const IntRect& newRect)
+{
+ IntRect oldRect = frameRect();
+
+ if (newRect == oldRect)
+ return;
+
+ Widget::setFrameRect(newRect);
+
+ frameRectsChanged();
+}
+
+void FrameletView::setParentVisible(bool parentVisible)
+{
+ if (isParentVisible() == parentVisible)
+ return;
+
+ Widget::setParentVisible(parentVisible);
+ if (!isSelfVisible())
+ return;
+
+ m_framelet->updateVisibility(isVisible());
+}
+
+void FrameletView::show()
+{
+ setSelfVisible(true);
+ m_framelet->updateVisibility(true);
+ Widget::show();
+}
+
+DEFINE_TRACE(FrameletView)
+{
+ visitor->trace(m_framelet);
+ Widget::trace(visitor);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameletView.h ('k') | third_party/WebKit/Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698