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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/printing/cups_print_job_manager.cc
diff --git a/chrome/browser/chromeos/printing/cups_print_job_manager.cc b/chrome/browser/chromeos/printing/cups_print_job_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a5f502fcc418e5bece73608d67c2343c749d9e5b
--- /dev/null
+++ b/chrome/browser/chromeos/printing/cups_print_job_manager.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/printing/cups_print_job_manager.h"
+
+#include <algorithm>
+
+#include "chrome/browser/chromeos/printing/cups_print_job_notification_manager.h"
+
+namespace chromeos {
+
+CupsPrintJobManager::CupsPrintJobManager(Profile* profile) : profile_(profile) {
+ notification_manager_.reset(
+ new CupsPrintJobNotificationManager(profile, this));
+}
+
+CupsPrintJobManager::~CupsPrintJobManager() {
+ print_jobs_.clear();
+ notification_manager_.reset();
+ profile_ = nullptr;
+}
+
+void CupsPrintJobManager::Shutdown() {}
+
+void CupsPrintJobManager::AddObserver(Observer* observer) {
+ auto found = std::find(observers_.begin(), observers_.end(), observer);
+ if (found == observers_.end())
+ observers_.push_back(observer);
+}
+
+void CupsPrintJobManager::RemoveObserver(Observer* observer) {
+ auto found = std::find(observers_.begin(), observers_.end(), observer);
+ if (found != observers_.end())
+ observers_.erase(found);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698