| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/printing/cups_print_job_manager.h" |
| 6 |
| 7 #include <algorithm> |
| 8 |
| 9 #include "chrome/browser/chromeos/printing/cups_print_job_notification_manager.h
" |
| 10 |
| 11 namespace chromeos { |
| 12 |
| 13 CupsPrintJobManager::CupsPrintJobManager(Profile* profile) : profile_(profile) { |
| 14 notification_manager_.reset( |
| 15 new CupsPrintJobNotificationManager(profile, this)); |
| 16 } |
| 17 |
| 18 CupsPrintJobManager::~CupsPrintJobManager() { |
| 19 print_jobs_.clear(); |
| 20 notification_manager_.reset(); |
| 21 profile_ = nullptr; |
| 22 } |
| 23 |
| 24 void CupsPrintJobManager::Shutdown() {} |
| 25 |
| 26 void CupsPrintJobManager::AddObserver(Observer* observer) { |
| 27 auto found = std::find(observers_.begin(), observers_.end(), observer); |
| 28 if (found == observers_.end()) |
| 29 observers_.push_back(observer); |
| 30 } |
| 31 |
| 32 void CupsPrintJobManager::RemoveObserver(Observer* observer) { |
| 33 auto found = std::find(observers_.begin(), observers_.end(), observer); |
| 34 if (found != observers_.end()) |
| 35 observers_.erase(found); |
| 36 } |
| 37 |
| 38 } // namespace chromeos |
| OLD | NEW |