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_dialog_controller.h" | 5 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 return NULL; | 360 return NULL; |
361 } | 361 } |
362 | 362 |
363 // static | 363 // static |
364 bool PrintPreviewDialogController::IsPrintPreviewDialog(WebContents* contents) { | 364 bool PrintPreviewDialogController::IsPrintPreviewDialog(WebContents* contents) { |
365 return IsPrintPreviewURL(contents->GetURL()); | 365 return IsPrintPreviewURL(contents->GetURL()); |
366 } | 366 } |
367 | 367 |
368 // static | 368 // static |
369 bool PrintPreviewDialogController::IsPrintPreviewURL(const GURL& url) { | 369 bool PrintPreviewDialogController::IsPrintPreviewURL(const GURL& url) { |
370 return (url.SchemeIs(chrome::kChromeUIScheme) && | 370 return (url.SchemeIs(content::kChromeUIScheme) && |
371 url.host() == chrome::kChromeUIPrintHost); | 371 url.host() == chrome::kChromeUIPrintHost); |
372 } | 372 } |
373 | 373 |
374 void PrintPreviewDialogController::EraseInitiatorInfo( | 374 void PrintPreviewDialogController::EraseInitiatorInfo( |
375 WebContents* preview_dialog) { | 375 WebContents* preview_dialog) { |
376 for (size_t i = 0; i < preview_operations_.size(); ++i) { | 376 for (size_t i = 0; i < preview_operations_.size(); ++i) { |
377 Operation* operation = preview_operations_[i]; | 377 Operation* operation = preview_operations_[i]; |
378 if (operation->preview_dialog == preview_dialog) { | 378 if (operation->preview_dialog == preview_dialog) { |
379 operation->initiator_observer.StopObserving(); | 379 operation->initiator_observer.StopObserving(); |
380 operation->initiator = NULL; | 380 operation->initiator = NULL; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 preview_operations_.erase(preview_operations_.begin() + i); | 563 preview_operations_.erase(preview_operations_.begin() + i); |
564 delete operation; | 564 delete operation; |
565 | 565 |
566 return; | 566 return; |
567 } | 567 } |
568 } | 568 } |
569 NOTREACHED(); | 569 NOTREACHED(); |
570 } | 570 } |
571 | 571 |
572 } // namespace printing | 572 } // namespace printing |
OLD | NEW |