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

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

Powered by Google App Engine
This is Rietveld 408576698