OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3194 registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, | 3194 registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, |
3195 content::Source<TabContents>(contents->tab_contents())); | 3195 content::Source<TabContents>(contents->tab_contents())); |
3196 | 3196 |
3197 registrar_.Add(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED, | 3197 registrar_.Add(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED, |
3198 content::Source<TabContents>(contents->tab_contents())); | 3198 content::Source<TabContents>(contents->tab_contents())); |
3199 } | 3199 } |
3200 | 3200 |
3201 void Browser::TabClosingAt(TabStripModel* tab_strip_model, | 3201 void Browser::TabClosingAt(TabStripModel* tab_strip_model, |
3202 TabContentsWrapper* contents, | 3202 TabContentsWrapper* contents, |
3203 int index) { | 3203 int index) { |
| 3204 if (fullscreened_tab_ == contents) { |
| 3205 ExitTabbedFullscreenModeIfNecessary(); |
| 3206 // The call to exit fullscreen may result in asynchronous notification of |
| 3207 // fullscreen state change (e.g., on Linux). We don't want to rely on it |
| 3208 // to call NotifyTabOfFullscreenExitIfNecessary(), because at that point |
| 3209 // |fullscreen_tab_| may not be valid. Instead, we call it here to clean up |
| 3210 // tab fullscreen related state. |
| 3211 NotifyTabOfFullscreenExitIfNecessary(); |
| 3212 } |
3204 content::NotificationService::current()->Notify( | 3213 content::NotificationService::current()->Notify( |
3205 content::NOTIFICATION_TAB_CLOSING, | 3214 content::NOTIFICATION_TAB_CLOSING, |
3206 content::Source<NavigationController>(&contents->controller()), | 3215 content::Source<NavigationController>(&contents->controller()), |
3207 content::NotificationService::NoDetails()); | 3216 content::NotificationService::NoDetails()); |
3208 | 3217 |
3209 // Sever the TabContents' connection back to us. | 3218 // Sever the TabContents' connection back to us. |
3210 SetAsDelegate(contents, NULL); | 3219 SetAsDelegate(contents, NULL); |
3211 } | 3220 } |
3212 | 3221 |
3213 void Browser::TabDetachedAt(TabContentsWrapper* contents, int index) { | 3222 void Browser::TabDetachedAt(TabContentsWrapper* contents, int index) { |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5499 } | 5508 } |
5500 | 5509 |
5501 void Browser::UpdateFullscreenExitBubbleContent() { | 5510 void Browser::UpdateFullscreenExitBubbleContent() { |
5502 GURL url; | 5511 GURL url; |
5503 if (fullscreened_tab_) | 5512 if (fullscreened_tab_) |
5504 url = fullscreened_tab_->tab_contents()->GetURL(); | 5513 url = fullscreened_tab_->tab_contents()->GetURL(); |
5505 | 5514 |
5506 window_->UpdateFullscreenExitBubbleContent( | 5515 window_->UpdateFullscreenExitBubbleContent( |
5507 url, GetFullscreenExitBubbleType()); | 5516 url, GetFullscreenExitBubbleType()); |
5508 } | 5517 } |
OLD | NEW |