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

Unified Diff: chrome/browser/search/contextual_search_api_controller.cc

Issue 1385663002: [Contextual Search] Add Mojo-enabled API component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Pedro's comments on naming methods in ContextualSearchApiController. Created 5 years, 2 months 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/search/contextual_search_api_controller.cc
diff --git a/chrome/browser/search/contextual_search_api_controller.cc b/chrome/browser/search/contextual_search_api_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7b49559a64f9b29732fb0e0da66910cde07a2be9
--- /dev/null
+++ b/chrome/browser/search/contextual_search_api_controller.cc
@@ -0,0 +1,29 @@
+// Copyright 2015 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/search/contextual_search_api_controller.h"
+
+#include "content/public/browser/render_process_host.h"
+
+// static
+ContextualSearchApiController* ContextualSearchApiController::GetInstance() {
+ return base::Singleton<ContextualSearchApiController>::get();
+}
+
+ContextualSearchApiController::ContextualSearchApiController() {}
+
+ContextualSearchApiController::~ContextualSearchApiController() {}
+
+void ContextualSearchApiController::AddProcessId(int process_id) {
+ process_ids_.insert(process_id);
+}
+
+void ContextualSearchApiController::RemoveProcessId(int process_id) {
+ process_ids_.erase(process_id);
+}
+
+bool ContextualSearchApiController::IsContextualSearchProcessId(
+ int process_id) const {
+ return process_ids_.find(process_id) != process_ids_.end();
+}

Powered by Google App Engine
This is Rietveld 408576698