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

Side by Side Diff: chrome/browser/extensions/api/automation_internal/automation_event_router.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h" 5 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou ter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/common/extensions/api/automation_internal.h" 13 #include "chrome/common/extensions/api/automation_internal.h"
14 #include "chrome/common/extensions/chrome_extension_messages.h" 14 #include "chrome/common/extensions/chrome_extension_messages.h"
15 #include "content/public/browser/notification_service.h" 15 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/notification_source.h" 16 #include "content/public/browser/notification_source.h"
17 #include "content/public/browser/notification_types.h" 17 #include "content/public/browser/notification_types.h"
18 #include "content/public/browser/render_process_host.h" 18 #include "content/public/browser/render_process_host.h"
19 #include "extensions/browser/event_router.h" 19 #include "extensions/browser/event_router.h"
20 #include "ui/accessibility/ax_enums.h" 20 #include "ui/accessibility/ax_enums.h"
21 #include "ui/accessibility/ax_node_data.h" 21 #include "ui/accessibility/ax_node_data.h"
22 22
23 namespace extensions { 23 namespace extensions {
24 24
25 // static 25 // static
26 AutomationEventRouter* AutomationEventRouter::GetInstance() { 26 AutomationEventRouter* AutomationEventRouter::GetInstance() {
27 return Singleton<AutomationEventRouter, 27 return base::Singleton<
28 LeakySingletonTraits<AutomationEventRouter>>::get(); 28 AutomationEventRouter,
29 base::LeakySingletonTraits<AutomationEventRouter>>::get();
29 } 30 }
30 31
31 AutomationEventRouter::AutomationEventRouter() { 32 AutomationEventRouter::AutomationEventRouter() {
32 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 33 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
33 content::NotificationService::AllBrowserContextsAndSources()); 34 content::NotificationService::AllBrowserContextsAndSources());
34 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, 35 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
35 content::NotificationService::AllBrowserContextsAndSources()); 36 content::NotificationService::AllBrowserContextsAndSources());
36 } 37 }
37 38
38 AutomationEventRouter::~AutomationEventRouter() { 39 AutomationEventRouter::~AutomationEventRouter() {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 std::remove_if( 135 std::remove_if(
135 listeners_.begin(), 136 listeners_.begin(),
136 listeners_.end(), 137 listeners_.end(),
137 [process_id](const AutomationListener& item) { 138 [process_id](const AutomationListener& item) {
138 return item.process_id == process_id; 139 return item.process_id == process_id;
139 }), 140 }),
140 listeners_.end()); 141 listeners_.end());
141 } 142 }
142 143
143 } // namespace extensions 144 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698