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

Side by Side Diff: chrome/renderer/chrome_render_thread_observer.h

Issue 2514593002: Field trial synchronization to PPAPI process. (Closed)
Patch Set: Fix namespace. Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_RENDERER_CHROME_RENDER_THREAD_OBSERVER_H_ 5 #ifndef CHROME_RENDERER_CHROME_RENDER_THREAD_OBSERVER_H_
6 #define CHROME_RENDERER_CHROME_RENDER_THREAD_OBSERVER_H_ 6 #define CHROME_RENDERER_CHROME_RENDER_THREAD_OBSERVER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/metrics/field_trial.h" 14 #include "base/metrics/field_trial.h"
15 #include "chrome/common/variations/child_process_field_trial_syncer.h"
16 #include "components/content_settings/core/common/content_settings.h" 15 #include "components/content_settings/core/common/content_settings.h"
16 #include "components/variations/child_process_field_trial_syncer.h"
17 #include "content/public/renderer/render_thread_observer.h" 17 #include "content/public/renderer/render_thread_observer.h"
18 18
19 class GURL; 19 class GURL;
20 struct ContentSettings; 20 struct ContentSettings;
21 21
22 namespace base {
23 class CommandLine;
24 }
25
26 namespace content { 22 namespace content {
27 class ResourceDispatcherDelegate; 23 class ResourceDispatcherDelegate;
28 } 24 }
29 25
30 namespace visitedlink { 26 namespace visitedlink {
31 class VisitedLinkSlave; 27 class VisitedLinkSlave;
32 } 28 }
33 29
34 // This class filters the incoming control messages (i.e. ones not destined for 30 // This class filters the incoming control messages (i.e. ones not destined for
35 // a RenderView) for Chrome specific messages that the content layer doesn't 31 // a RenderView) for Chrome specific messages that the content layer doesn't
36 // happen. If a few messages are related, they should probably have their own 32 // happen. If a few messages are related, they should probably have their own
37 // observer. 33 // observer.
38 class ChromeRenderThreadObserver : public content::RenderThreadObserver, 34 class ChromeRenderThreadObserver : public content::RenderThreadObserver,
39 public base::FieldTrialList::Observer { 35 public base::FieldTrialList::Observer {
40 public: 36 public:
41 ChromeRenderThreadObserver(); 37 ChromeRenderThreadObserver();
42 ~ChromeRenderThreadObserver() override; 38 ~ChromeRenderThreadObserver() override;
43 39
44 static bool is_incognito_process() { return is_incognito_process_; } 40 static bool is_incognito_process() { return is_incognito_process_; }
45 41
46 // Returns a pointer to the content setting rules owned by 42 // Returns a pointer to the content setting rules owned by
47 // |ChromeRenderThreadObserver|. 43 // |ChromeRenderThreadObserver|.
48 const RendererContentSettingRules* content_setting_rules() const; 44 const RendererContentSettingRules* content_setting_rules() const;
49 45
50 visitedlink::VisitedLinkSlave* visited_link_slave() { 46 visitedlink::VisitedLinkSlave* visited_link_slave() {
51 return visited_link_slave_.get(); 47 return visited_link_slave_.get();
52 } 48 }
53 49
54 private: 50 private:
55 // Initializes field trial state change observation and notifies the browser
56 // of any field trials that might have already been activated.
57 void InitFieldTrialObserving(const base::CommandLine& command_line);
58
59 // content::RenderThreadObserver: 51 // content::RenderThreadObserver:
60 bool OnControlMessageReceived(const IPC::Message& message) override; 52 bool OnControlMessageReceived(const IPC::Message& message) override;
61 void OnRenderProcessShutdown() override; 53 void OnRenderProcessShutdown() override;
62 54
63 // base::FieldTrialList::Observer: 55 // base::FieldTrialList::Observer:
64 void OnFieldTrialGroupFinalized(const std::string& trial_name, 56 void OnFieldTrialGroupFinalized(const std::string& trial_name,
65 const std::string& group_name) override; 57 const std::string& group_name) override;
66 58
67 void OnSetIsIncognitoProcess(bool is_incognito_process); 59 void OnSetIsIncognitoProcess(bool is_incognito_process);
68 void OnSetContentSettingsForCurrentURL( 60 void OnSetContentSettingsForCurrentURL(
69 const GURL& url, const ContentSettings& content_settings); 61 const GURL& url, const ContentSettings& content_settings);
70 void OnSetContentSettingRules(const RendererContentSettingRules& rules); 62 void OnSetContentSettingRules(const RendererContentSettingRules& rules);
71 void OnGetCacheResourceStats(); 63 void OnGetCacheResourceStats();
72 void OnSetFieldTrialGroup(const std::string& trial_name, 64 void OnSetFieldTrialGroup(const std::string& trial_name,
73 const std::string& group_name); 65 const std::string& group_name);
74 66
75 static bool is_incognito_process_; 67 static bool is_incognito_process_;
76 std::unique_ptr<content::ResourceDispatcherDelegate> resource_delegate_; 68 std::unique_ptr<content::ResourceDispatcherDelegate> resource_delegate_;
77 RendererContentSettingRules content_setting_rules_; 69 RendererContentSettingRules content_setting_rules_;
78 chrome_variations::ChildProcessFieldTrialSyncer field_trial_syncer_; 70 variations::ChildProcessFieldTrialSyncer field_trial_syncer_;
79 71
80 std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_; 72 std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
81 73
82 base::WeakPtrFactory<ChromeRenderThreadObserver> weak_factory_; 74 base::WeakPtrFactory<ChromeRenderThreadObserver> weak_factory_;
83 75
84 DISALLOW_COPY_AND_ASSIGN(ChromeRenderThreadObserver); 76 DISALLOW_COPY_AND_ASSIGN(ChromeRenderThreadObserver);
85 }; 77 };
86 78
87 #endif // CHROME_RENDERER_CHROME_RENDER_THREAD_OBSERVER_H_ 79 #endif // CHROME_RENDERER_CHROME_RENDER_THREAD_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/gpu/chrome_content_gpu_client.cc ('k') | chrome/renderer/chrome_render_thread_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698