Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: chrome/browser/chromeos/printing/cups_print_job_manager.cc

Issue 2435303003: [CUPS] Implement the Print Job notification. (Closed)
Patch Set: Fix the compile warning. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698