| 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/printing/print_preview_tab_controller.h" | 5 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 if (preview_tab->web_ui()) { | 264 if (preview_tab->web_ui()) { |
| 265 PrintPreviewUI* print_preview_ui = | 265 PrintPreviewUI* print_preview_ui = |
| 266 static_cast<PrintPreviewUI*>(preview_tab->web_ui()); | 266 static_cast<PrintPreviewUI*>(preview_tab->web_ui()); |
| 267 print_preview_ui->OnInitiatorTabClosed(); | 267 print_preview_ui->OnInitiatorTabClosed(); |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 | 271 |
| 272 // static | 272 // static |
| 273 bool PrintPreviewTabController::IsPrintPreviewTab(TabContentsWrapper* tab) { | 273 bool PrintPreviewTabController::IsPrintPreviewTab(TabContentsWrapper* tab) { |
| 274 const GURL& url = tab->tab_contents()->GetURL(); | 274 return IsPrintPreviewURL(tab->tab_contents()->GetURL()); |
| 275 } |
| 276 |
| 277 // static |
| 278 bool PrintPreviewTabController::IsPrintPreviewURL(const GURL& url) { |
| 275 return (url.SchemeIs(chrome::kChromeUIScheme) && | 279 return (url.SchemeIs(chrome::kChromeUIScheme) && |
| 276 url.host() == chrome::kChromeUIPrintHost); | 280 url.host() == chrome::kChromeUIPrintHost); |
| 277 } | 281 } |
| 278 | 282 |
| 279 void PrintPreviewTabController::EraseInitiatorTabInfo( | 283 void PrintPreviewTabController::EraseInitiatorTabInfo( |
| 280 TabContentsWrapper* preview_tab) { | 284 TabContentsWrapper* preview_tab) { |
| 281 PrintPreviewTabMap::iterator it = preview_tab_map_.find(preview_tab); | 285 PrintPreviewTabMap::iterator it = preview_tab_map_.find(preview_tab); |
| 282 if (it == preview_tab_map_.end()) | 286 if (it == preview_tab_map_.end()) |
| 283 return; | 287 return; |
| 284 | 288 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 RenderProcessHost* rph = tab->render_view_host()->process(); | 389 RenderProcessHost* rph = tab->render_view_host()->process(); |
| 386 if (registrar_.IsRegistered(this, | 390 if (registrar_.IsRegistered(this, |
| 387 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 391 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
| 388 Source<RenderProcessHost>(rph))) { | 392 Source<RenderProcessHost>(rph))) { |
| 389 registrar_.Remove(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 393 registrar_.Remove(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
| 390 Source<RenderProcessHost>(rph)); | 394 Source<RenderProcessHost>(rph)); |
| 391 } | 395 } |
| 392 } | 396 } |
| 393 | 397 |
| 394 } // namespace printing | 398 } // namespace printing |
| OLD | NEW |