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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_action_view.h

Issue 615543006: Fix use-after-free in BrowserActionView::~BrowserActionView() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_
7 7
8 #include "chrome/browser/ui/views/extensions/extension_action_view_controller.h" 8 #include "chrome/browser/ui/views/extensions/extension_action_view_controller.h"
9 #include "chrome/browser/ui/views/extensions/extension_action_view_delegate.h" 9 #include "chrome/browser/ui/views/extensions/extension_action_view_delegate.h"
10 #include "content/public/browser/notification_observer.h" 10 #include "content/public/browser/notification_observer.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 virtual ExtensionActionViewController* GetPreferredPopupViewController() 162 virtual ExtensionActionViewController* GetPreferredPopupViewController()
163 OVERRIDE; 163 OVERRIDE;
164 virtual views::View* GetReferenceViewForPopup() OVERRIDE; 164 virtual views::View* GetReferenceViewForPopup() OVERRIDE;
165 virtual views::MenuButton* GetContextMenuButton() OVERRIDE; 165 virtual views::MenuButton* GetContextMenuButton() OVERRIDE;
166 virtual content::WebContents* GetCurrentWebContents() OVERRIDE; 166 virtual content::WebContents* GetCurrentWebContents() OVERRIDE;
167 virtual void HideActivePopup() OVERRIDE; 167 virtual void HideActivePopup() OVERRIDE;
168 virtual void OnIconUpdated() OVERRIDE; 168 virtual void OnIconUpdated() OVERRIDE;
169 virtual void OnPopupShown(bool grant_tab_permissions) OVERRIDE; 169 virtual void OnPopupShown(bool grant_tab_permissions) OVERRIDE;
170 virtual void CleanupPopup() OVERRIDE; 170 virtual void CleanupPopup() OVERRIDE;
171 171
172 // A lock to keep the MenuButton pressed when a menu or popup is visible.
173 // This needs to be destroyed after |view_controller_|, because
174 // |view_controller_|'s destructor can call CleanupPopup(), which uses this
175 // object.
176 scoped_ptr<views::MenuButton::PressedLock> pressed_lock_;
177
172 // The controller for this ExtensionAction view. 178 // The controller for this ExtensionAction view.
173 scoped_ptr<ExtensionActionViewController> view_controller_; 179 scoped_ptr<ExtensionActionViewController> view_controller_;
174 180
175 // Delegate that usually represents a container for BrowserActionView. 181 // Delegate that usually represents a container for BrowserActionView.
176 BrowserActionView::Delegate* delegate_; 182 BrowserActionView::Delegate* delegate_;
177 183
178 // Used to make sure we only register the command once. 184 // Used to make sure we only register the command once.
179 bool called_registered_extension_command_; 185 bool called_registered_extension_command_;
180 186
181 content::NotificationRegistrar registrar_; 187 content::NotificationRegistrar registrar_;
182 188
183 // The observer that we need to notify when the icon of the button has been 189 // The observer that we need to notify when the icon of the button has been
184 // updated. 190 // updated.
185 IconObserver* icon_observer_; 191 IconObserver* icon_observer_;
186 192
187 // A lock to keep the MenuButton pressed when a menu or popup is visible.
188 scoped_ptr<views::MenuButton::PressedLock> pressed_lock_;
189
190 DISALLOW_COPY_AND_ASSIGN(BrowserActionView); 193 DISALLOW_COPY_AND_ASSIGN(BrowserActionView);
191 }; 194 };
192 195
193 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ 196 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698