| OLD | NEW |
| 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_PROCESS_OBSERVER_H_ | 5 #ifndef CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ |
| 6 #define CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ | 6 #define CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // happen. If a few messages are related, they should probably have their own | 33 // happen. If a few messages are related, they should probably have their own |
| 34 // observer. | 34 // observer. |
| 35 class ChromeRenderProcessObserver : public content::RenderProcessObserver, | 35 class ChromeRenderProcessObserver : public content::RenderProcessObserver, |
| 36 public base::FieldTrialList::Observer { | 36 public base::FieldTrialList::Observer { |
| 37 public: | 37 public: |
| 38 ChromeRenderProcessObserver(); | 38 ChromeRenderProcessObserver(); |
| 39 ~ChromeRenderProcessObserver() override; | 39 ~ChromeRenderProcessObserver() override; |
| 40 | 40 |
| 41 static bool is_incognito_process() { return is_incognito_process_; } | 41 static bool is_incognito_process() { return is_incognito_process_; } |
| 42 | 42 |
| 43 bool webkit_initialized() const { return webkit_initialized_; } | |
| 44 | |
| 45 // Returns a pointer to the content setting rules owned by | 43 // Returns a pointer to the content setting rules owned by |
| 46 // |ChromeRenderProcessObserver|. | 44 // |ChromeRenderProcessObserver|. |
| 47 const RendererContentSettingRules* content_setting_rules() const; | 45 const RendererContentSettingRules* content_setting_rules() const; |
| 48 | 46 |
| 49 private: | 47 private: |
| 50 // Initializes field trial state change observation and notifies the browser | 48 // Initializes field trial state change observation and notifies the browser |
| 51 // of any field trials that might have already been activated. | 49 // of any field trials that might have already been activated. |
| 52 void InitFieldTrialObserving(const base::CommandLine& command_line); | 50 void InitFieldTrialObserving(const base::CommandLine& command_line); |
| 53 | 51 |
| 54 // content::RenderProcessObserver: | 52 // content::RenderProcessObserver: |
| 55 bool OnControlMessageReceived(const IPC::Message& message) override; | 53 bool OnControlMessageReceived(const IPC::Message& message) override; |
| 56 void WebKitInitialized() override; | |
| 57 void OnRenderProcessShutdown() override; | |
| 58 | 54 |
| 59 // base::FieldTrialList::Observer: | 55 // base::FieldTrialList::Observer: |
| 60 void OnFieldTrialGroupFinalized(const std::string& trial_name, | 56 void OnFieldTrialGroupFinalized(const std::string& trial_name, |
| 61 const std::string& group_name) override; | 57 const std::string& group_name) override; |
| 62 | 58 |
| 63 void OnSetIsIncognitoProcess(bool is_incognito_process); | 59 void OnSetIsIncognitoProcess(bool is_incognito_process); |
| 64 void OnSetContentSettingsForCurrentURL( | 60 void OnSetContentSettingsForCurrentURL( |
| 65 const GURL& url, const ContentSettings& content_settings); | 61 const GURL& url, const ContentSettings& content_settings); |
| 66 void OnSetContentSettingRules(const RendererContentSettingRules& rules); | 62 void OnSetContentSettingRules(const RendererContentSettingRules& rules); |
| 67 void OnGetCacheResourceStats(); | 63 void OnGetCacheResourceStats(); |
| 68 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, | 64 void OnSetFieldTrialGroup(const std::string& fiel_trial_name, |
| 69 const std::string& group_name, | 65 const std::string& group_name, |
| 70 base::ProcessId sender_pid); | 66 base::ProcessId sender_pid); |
| 71 | 67 |
| 72 static bool is_incognito_process_; | 68 static bool is_incognito_process_; |
| 73 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; | 69 scoped_ptr<content::ResourceDispatcherDelegate> resource_delegate_; |
| 74 RendererContentSettingRules content_setting_rules_; | 70 RendererContentSettingRules content_setting_rules_; |
| 75 | 71 |
| 76 bool webkit_initialized_; | |
| 77 | |
| 78 base::WeakPtrFactory<ChromeRenderProcessObserver> weak_factory_; | 72 base::WeakPtrFactory<ChromeRenderProcessObserver> weak_factory_; |
| 79 | 73 |
| 80 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); | 74 DISALLOW_COPY_AND_ASSIGN(ChromeRenderProcessObserver); |
| 81 }; | 75 }; |
| 82 | 76 |
| 83 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ | 77 #endif // CHROME_RENDERER_CHROME_RENDER_PROCESS_OBSERVER_H_ |
| OLD | NEW |