OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/printing/print_preview_tab_controller.h" | 5 #include "chrome/browser/printing/print_preview_tab_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 content::Source<content::RenderProcessHost>(source).ptr()); | 270 content::Source<content::RenderProcessHost>(source).ptr()); |
271 break; | 271 break; |
272 } | 272 } |
273 case chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED: { | 273 case chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED: { |
274 OnTabContentsDestroyed(content::Source<TabContents>(source).ptr()); | 274 OnTabContentsDestroyed(content::Source<TabContents>(source).ptr()); |
275 break; | 275 break; |
276 } | 276 } |
277 case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { | 277 case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { |
278 NavigationController* controller = | 278 NavigationController* controller = |
279 content::Source<NavigationController>(source).ptr(); | 279 content::Source<NavigationController>(source).ptr(); |
280 TabContents* tab = TabContents::GetCurrentWrapperForContents( | 280 TabContents* tab = TabContents::FromWebContents( |
281 controller->GetWebContents()); | 281 controller->GetWebContents()); |
282 content::LoadCommittedDetails* load_details = | 282 content::LoadCommittedDetails* load_details = |
283 content::Details<content::LoadCommittedDetails>(details).ptr(); | 283 content::Details<content::LoadCommittedDetails>(details).ptr(); |
284 OnNavEntryCommitted(tab, load_details); | 284 OnNavEntryCommitted(tab, load_details); |
285 break; | 285 break; |
286 } | 286 } |
287 default: { | 287 default: { |
288 NOTREACHED(); | 288 NOTREACHED(); |
289 break; | 289 break; |
290 } | 290 } |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 537 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
538 preview_tab->web_contents()->GetWebUI()->GetController()); | 538 preview_tab->web_contents()->GetWebUI()->GetController()); |
539 if (print_preview_ui) | 539 if (print_preview_ui) |
540 print_preview_ui->OnTabDestroyed(); | 540 print_preview_ui->OnTabDestroyed(); |
541 | 541 |
542 preview_tab_map_.erase(preview_tab); | 542 preview_tab_map_.erase(preview_tab); |
543 RemoveObservers(preview_tab); | 543 RemoveObservers(preview_tab); |
544 } | 544 } |
545 | 545 |
546 } // namespace printing | 546 } // namespace printing |
OLD | NEW |