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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm

Issue 14242004: Speculative fix for instant overlay crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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: chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm b/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
index 34b6a824b49d915446ff7759bb823ecc2a858301..dc22eb9d00771fda4ff34e42e141aba0f89707d5 100644
--- a/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.mm
@@ -6,6 +6,7 @@
#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_instant_controller.h"
kuan 2013/04/15 15:05:53 nit: is this needed for ur changes?
sail 2013/04/15 15:56:57 Done. Removed.
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h"
#import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h"
@@ -13,6 +14,8 @@
#include "chrome/browser/ui/search/search_model.h"
#include "chrome/browser/ui/search/search_tab_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "content/public/browser/notification_source.h"
+#include "content/public/browser/notification_types.h"
InstantOverlayControllerMac::InstantOverlayControllerMac(
Browser* browser,
@@ -69,4 +72,20 @@ void InstantOverlayControllerMac::OverlayStateChanged(
}
[window_ updateBookmarkBarStateForInstantOverlay];
+
+ registrar_.RemoveAll();
+ if (model.GetOverlayContents()) {
+ registrar_.Add(
+ this,
+ content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
+ content::Source<content::WebContents>(model.GetOverlayContents()));
kuan 2013/04/15 15:05:53 note that model.GetOverlayContents() is the same w
sail 2013/04/15 15:56:57 Registration is super cheap so I don't think it's
kuan 2013/04/15 15:58:36 ok.
+ }
+}
+
+void InstantOverlayControllerMac::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ [overlay_ onWebContentsDestroyed:
+ content::Source<content::WebContents>(source).ptr()];
}

Powered by Google App Engine
This is Rietveld 408576698