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

Side by Side Diff: chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.h

Issue 2710823003: NOCOMMIT prototype: GRC service plumbing and process priority
Patch Set: Rebase Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_RESOURCE_COORDINATOR_WEB_CONTENTS_OB SERVER_H_ 5 #ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_RESOURCE_COORDINATOR_WEB_CONTENTS_OB SERVER_H_
6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_RESOURCE_COORDINATOR_WEB_CONTENTS_OB SERVER_H_ 6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_RESOURCE_COORDINATOR_WEB_CONTENTS_OB SERVER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_contents_user_data.h" 10 #include "content/public/browser/web_contents_user_data.h"
11 #include "services/resource_coordinator/public/cpp/resource_coordinator_interfac e.h" 11 #include "services/resource_coordinator/public/cpp/resource_coordinator_interfac e.h"
12 12
13 class ResourceCoordinatorWebContentsObserver 13 class ResourceCoordinatorWebContentsObserver
14 : public content::WebContentsObserver, 14 : public content::WebContentsObserver,
15 public content::WebContentsUserData< 15 public content::WebContentsUserData<
16 ResourceCoordinatorWebContentsObserver> { 16 ResourceCoordinatorWebContentsObserver> {
17 public: 17 public:
18 ~ResourceCoordinatorWebContentsObserver() override; 18 ~ResourceCoordinatorWebContentsObserver() override;
19 19
20 static bool IsEnabled(); 20 static bool IsEnabled();
21 21
22 resource_coordinator::ResourceCoordinatorInterface* 22 resource_coordinator::ResourceCoordinatorInterface*
23 tab_resource_coordinator() { 23 tab_resource_coordinator() {
24 return tab_resource_coordinator_.get(); 24 return tab_resource_coordinator_.get();
25 } 25 }
26 26
27 // WebContentsObserver implementation. 27 // WebContentsObserver implementation.
28 void WasShown() override; 28 void WasShown() override;
29 void WasHidden() override; 29 void WasHidden() override;
30 void ReadyToCommitNavigation(
31 content::NavigationHandle* navigation_handle) override;
32 void DidFinishNavigation(
33 content::NavigationHandle* navigation_handle) override;
30 34
31 private: 35 private:
32 explicit ResourceCoordinatorWebContentsObserver( 36 explicit ResourceCoordinatorWebContentsObserver(
33 content::WebContents* web_contents); 37 content::WebContents* web_contents);
34 38
35 friend class content::WebContentsUserData< 39 friend class content::WebContentsUserData<
36 ResourceCoordinatorWebContentsObserver>; 40 ResourceCoordinatorWebContentsObserver>;
37 41
38 std::unique_ptr<resource_coordinator::ResourceCoordinatorInterface> 42 std::unique_ptr<resource_coordinator::ResourceCoordinatorInterface>
39 tab_resource_coordinator_; 43 tab_resource_coordinator_;
40 44
41 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorWebContentsObserver); 45 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorWebContentsObserver);
42 }; 46 };
43 47
44 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_RESOURCE_COORDINATOR_WEB_CONTENTS _OBSERVER_H_ 48 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_RESOURCE_COORDINATOR_WEB_CONTENTS _OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698