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

Side by Side Diff: chrome/browser/task_manager/web_contents_information.cc

Issue 2197483003: Move the Mac Task Manager to the new backend code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark Created 4 years, 4 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 2014 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 #include "chrome/browser/task_manager/web_contents_information.h"
6 #include "content/public/browser/notification_service.h"
7 #include "content/public/browser/notification_types.h"
8
9 namespace task_manager {
10
11 WebContentsInformation::WebContentsInformation() {}
12
13 WebContentsInformation::~WebContentsInformation() {}
14
15 NotificationObservingWebContentsInformation::
16 NotificationObservingWebContentsInformation() {}
17
18 NotificationObservingWebContentsInformation::
19 ~NotificationObservingWebContentsInformation() {}
20
21 void NotificationObservingWebContentsInformation::StartObservingCreation(
22 const NewWebContentsCallback& callback) {
23 observer_callback_ = callback;
24 registrar_.Add(this,
25 content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
26 content::NotificationService::AllBrowserContextsAndSources());
27 }
28
29 void NotificationObservingWebContentsInformation::StopObservingCreation() {
30 registrar_.Remove(
31 this,
32 content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
33 content::NotificationService::AllBrowserContextsAndSources());
34 observer_callback_.Reset();
35 }
36
37 void NotificationObservingWebContentsInformation::Observe(
38 int type,
39 const content::NotificationSource& source,
40 const content::NotificationDetails& details) {
41 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_CONNECTED, type);
42
43 content::WebContents* web_contents =
44 content::Source<content::WebContents>(source).ptr();
45 if (CheckOwnership(web_contents))
46 observer_callback_.Run(web_contents);
47 }
48
49 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/web_contents_information.h ('k') | chrome/browser/task_manager/web_contents_resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698