| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Carbon/Carbon.h> | 5 #import <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "chrome/browser/tab_contents/popup_menu_helper_mac.h" | 7 #include "chrome/browser/tab_contents/popup_menu_helper_mac.h" |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
| 11 #include "chrome/browser/renderer_host/render_view_host.h" | |
| 12 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 11 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 13 #import "chrome/browser/ui/cocoa/base_view.h" | 12 #import "chrome/browser/ui/cocoa/base_view.h" |
| 14 #import "chrome/common/chrome_application_mac.h" | 13 #import "chrome/common/chrome_application_mac.h" |
| 15 #include "chrome/common/notification_source.h" | 14 #include "chrome/common/notification_source.h" |
| 15 #include "content/browser/renderer_host/render_view_host.h" |
| 16 #include "webkit/glue/webmenurunner_mac.h" | 16 #include "webkit/glue/webmenurunner_mac.h" |
| 17 | 17 |
| 18 PopupMenuHelper::PopupMenuHelper(RenderViewHost* render_view_host) | 18 PopupMenuHelper::PopupMenuHelper(RenderViewHost* render_view_host) |
| 19 : render_view_host_(render_view_host) { | 19 : render_view_host_(render_view_host) { |
| 20 notification_registrar_.Add( | 20 notification_registrar_.Add( |
| 21 this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, | 21 this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, |
| 22 Source<RenderWidgetHost>(render_view_host)); | 22 Source<RenderWidgetHost>(render_view_host)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void PopupMenuHelper::ShowPopupMenu( | 25 void PopupMenuHelper::ShowPopupMenu( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void PopupMenuHelper::Observe( | 78 void PopupMenuHelper::Observe( |
| 79 NotificationType type, | 79 NotificationType type, |
| 80 const NotificationSource& source, | 80 const NotificationSource& source, |
| 81 const NotificationDetails& details) { | 81 const NotificationDetails& details) { |
| 82 DCHECK(type == NotificationType::RENDER_WIDGET_HOST_DESTROYED); | 82 DCHECK(type == NotificationType::RENDER_WIDGET_HOST_DESTROYED); |
| 83 RenderViewHost* rvh = Source<RenderViewHost>(source).ptr(); | 83 RenderViewHost* rvh = Source<RenderViewHost>(source).ptr(); |
| 84 DCHECK_EQ(render_view_host_, rvh); | 84 DCHECK_EQ(render_view_host_, rvh); |
| 85 render_view_host_ = NULL; | 85 render_view_host_ = NULL; |
| 86 } | 86 } |
| 87 | 87 |
| OLD | NEW |