OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" | 5 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" |
6 | 6 |
7 #include "chrome/browser/search/search.h" | 7 #include "chrome/browser/search/search.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #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.
| |
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
10 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" | 11 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" |
11 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" | 12 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
12 #include "chrome/browser/ui/search/instant_overlay_model.h" | 13 #include "chrome/browser/ui/search/instant_overlay_model.h" |
13 #include "chrome/browser/ui/search/search_model.h" | 14 #include "chrome/browser/ui/search/search_model.h" |
14 #include "chrome/browser/ui/search/search_tab_helper.h" | 15 #include "chrome/browser/ui/search/search_tab_helper.h" |
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
17 #include "content/public/browser/notification_source.h" | |
18 #include "content/public/browser/notification_types.h" | |
16 | 19 |
17 InstantOverlayControllerMac::InstantOverlayControllerMac( | 20 InstantOverlayControllerMac::InstantOverlayControllerMac( |
18 Browser* browser, | 21 Browser* browser, |
19 BrowserWindowController* window, | 22 BrowserWindowController* window, |
20 OverlayableContentsController* overlay) | 23 OverlayableContentsController* overlay) |
21 : InstantOverlayController(browser), | 24 : InstantOverlayController(browser), |
22 window_(window), | 25 window_(window), |
23 overlay_(overlay) { | 26 overlay_(overlay) { |
24 } | 27 } |
25 | 28 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 SearchTabHelper::FromWebContents(active_web_contents); | 65 SearchTabHelper::FromWebContents(active_web_contents); |
63 if (search_tab_helper && | 66 if (search_tab_helper && |
64 search_tab_helper->model()->mode().is_origin_default()) { | 67 search_tab_helper->model()->mode().is_origin_default()) { |
65 search_tab_helper->model()->SetTopBarsVisible( | 68 search_tab_helper->model()->SetTopBarsVisible( |
66 ![overlay_ isShowingOverlay]); | 69 ![overlay_ isShowingOverlay]); |
67 } | 70 } |
68 } | 71 } |
69 } | 72 } |
70 | 73 |
71 [window_ updateBookmarkBarStateForInstantOverlay]; | 74 [window_ updateBookmarkBarStateForInstantOverlay]; |
75 | |
76 registrar_.RemoveAll(); | |
77 if (model.GetOverlayContents()) { | |
78 registrar_.Add( | |
79 this, | |
80 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | |
81 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.
| |
82 } | |
72 } | 83 } |
84 | |
85 void InstantOverlayControllerMac::Observe( | |
86 int type, | |
87 const content::NotificationSource& source, | |
88 const content::NotificationDetails& details) { | |
89 [overlay_ onWebContentsDestroyed: | |
90 content::Source<content::WebContents>(source).ptr()]; | |
91 } | |
OLD | NEW |