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

Side by Side Diff: chrome/browser/search/contextual_search_api_controller.h

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, 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 2015 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 #ifndef CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_API_CONTROLLER_H_
6 #define CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_API_CONTROLLER_H_
7
8 #include <set>
9
10 #include "base/macros.h"
11 #include "base/memory/singleton.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
14
15 // Provides a singleton controller for the Contextual Search API.
16 // Tracks render process host IDs that are associated with ContextualSearch.
17 class ContextualSearchApiController {
18 public:
19 static ContextualSearchApiController* GetInstance();
20
21 // Add, remove, and query RenderProcessHost IDs that are associated with
22 // Contextual Search processes.
23 void AddProcessId(int process_id);
24 void RemoveProcessId(int process_id);
25 bool IsContextualSearchProcessId(int process_id) const;
26
27 private:
28 // Use GetInstance instead of constructing.
29 ContextualSearchApiController();
30 ~ContextualSearchApiController();
31
32 // Singleton:
33 friend struct base::DefaultSingletonTraits<ContextualSearchApiController>;
34
35 // The process ids associated with Contextual Search processes.
36 std::set<int> process_ids_;
37
38 DISALLOW_COPY_AND_ASSIGN(ContextualSearchApiController);
39 };
40
41 #endif // CHROME_BROWSER_SEARCH_CONTEXTUAL_SEARCH_API_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698