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

Side by Side 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, 10 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
(Empty)
1 // Copyright 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 file.
4
5 #include "core/frame/FrameletView.h"
6
7 #include "core/events/Event.h"
8 #include "core/frame/Framelet.h"
9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "core/layout/LayoutPart.h"
11
12 namespace blink {
13
14 FrameletView::FrameletView(Framelet* framelet)
15 : m_framelet(framelet)
16 {
17 ASSERT(framelet);
18 }
19
20 FrameletView::~FrameletView()
21 {
22 }
23
24 PassRefPtrWillBeRawPtr<FrameletView> FrameletView::create(Framelet* framelet)
25 {
26 RefPtrWillBeRawPtr<FrameletView> view = adoptRefWillBeNoop(new FrameletView( framelet));
27 view->show();
28 return view.release();
29 }
30
31 void FrameletView::dispose()
32 {
33 HTMLFrameOwnerElement* ownerElement = toHTMLFrameOwnerElement(m_framelet->ow ner());
34 if (ownerElement && ownerElement->ownedWidget() == this)
35 ownerElement->setWidget(nullptr);
36 }
37
38 void FrameletView::frameRectsChanged()
39 {
40 m_framelet->frameRectsChanged(frameRect());
41 }
42
43 void FrameletView::hide()
44 {
45 setSelfVisible(false);
46 m_framelet->updateVisibility(false);
47 Widget::hide();
48 }
49
50 void FrameletView::invalidateRect(const IntRect& rect)
51 {
52 LayoutPart* layoutObject = m_framelet->ownerLayoutObject();
53 if (!layoutObject)
54 return;
55
56 LayoutRect repaintRect(rect);
57 repaintRect.move(layoutObject->borderLeft() + layoutObject->paddingLeft(),
58 layoutObject->borderTop() + layoutObject->paddingTop());
59 layoutObject->invalidatePaintRectangle(repaintRect);
60 }
61
62 void FrameletView::setFocus(bool focused, WebFocusType focusType)
63 {
64 m_framelet->updateFocus(focused, focusType);
65 }
66
67 void FrameletView::setFrameRect(const IntRect& newRect)
68 {
69 IntRect oldRect = frameRect();
70
71 if (newRect == oldRect)
72 return;
73
74 Widget::setFrameRect(newRect);
75
76 frameRectsChanged();
77 }
78
79 void FrameletView::setParentVisible(bool parentVisible)
80 {
81 if (isParentVisible() == parentVisible)
82 return;
83
84 Widget::setParentVisible(parentVisible);
85 if (!isSelfVisible())
86 return;
87
88 m_framelet->updateVisibility(isVisible());
89 }
90
91 void FrameletView::show()
92 {
93 setSelfVisible(true);
94 m_framelet->updateVisibility(true);
95 Widget::show();
96 }
97
98 DEFINE_TRACE(FrameletView)
99 {
100 visitor->trace(m_framelet);
101 Widget::trace(visitor);
102 }
103
104 } // namespace blink
OLDNEW
« 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