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

Side by Side Diff: Source/web/PopupMenuChromium.cpp

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update OilpanExpectations Created 6 years, 3 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) 2008, 2009, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 30 matching lines...) Expand all
41 41
42 PopupMenuChromium::PopupMenuChromium(LocalFrame& frame, PopupMenuClient* client) 42 PopupMenuChromium::PopupMenuChromium(LocalFrame& frame, PopupMenuClient* client)
43 : m_popupClient(client) 43 : m_popupClient(client)
44 , m_frameView(frame.view()) 44 , m_frameView(frame.view())
45 { 45 {
46 } 46 }
47 47
48 PopupMenuChromium::~PopupMenuChromium() 48 PopupMenuChromium::~PopupMenuChromium()
49 { 49 {
50 // When the PopupMenuChromium is destroyed, the client could already have be en deleted. 50 // When the PopupMenuChromium is destroyed, the client could already have be en deleted.
51 if (m_popup) 51 if (m_popup) {
52 m_popup->listBox()->disconnectClient(); 52 m_popup->listBox()->disconnectClient();
53 hide(); 53 m_popup->hide();
54 }
54 } 55 }
55 56
56 void PopupMenuChromium::show(const FloatQuad& controlPosition, const IntSize& co ntrolSize, int index) 57 void PopupMenuChromium::show(const FloatQuad& controlPosition, const IntSize& co ntrolSize, int index)
57 { 58 {
58 if (!m_popup) { 59 if (!m_popup) {
59 bool deviceSupportsTouch = m_frameView->frame().settings()->deviceSuppor tsTouch(); 60 bool deviceSupportsTouch = m_frameView->frame().settings()->deviceSuppor tsTouch();
60 m_popup = PopupContainer::create(m_popupClient, deviceSupportsTouch); 61 m_popup = PopupContainer::create(m_popupClient, deviceSupportsTouch);
61 } 62 }
62 m_popup->showInRect(controlPosition, controlSize, m_frameView.get(), index); 63 m_popup->showInRect(controlPosition, controlSize, m_frameView.get(), index);
63 } 64 }
64 65
65 void PopupMenuChromium::hide() 66 void PopupMenuChromium::hide()
66 { 67 {
67 if (m_popup) 68 if (m_popup)
68 m_popup->hide(); 69 m_popup->hide();
69 } 70 }
70 71
71 void PopupMenuChromium::updateFromElement() 72 void PopupMenuChromium::updateFromElement()
72 { 73 {
73 m_popup->listBox()->updateFromElement(); 74 m_popup->listBox()->updateFromElement();
74 } 75 }
75 76
76 77
77 void PopupMenuChromium::disconnectClient() 78 void PopupMenuChromium::disconnectClient()
78 { 79 {
79 m_popupClient = 0; 80 m_popupClient = 0;
81 hide();
82 m_popup.clear();
haraken 2014/09/08 07:25:59 What is this change for?
sof 2014/09/08 21:17:46 The hiding during disconnect isn't separately need
80 } 83 }
81 84
82 } // namespace blink 85 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698