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

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

Issue 2582203003: Convert SetContentSettingRules to use mojo, part 1/2. (Closed)
Patch Set: Convert SetContentSettingRules to use mojo, part 1/2. Created 3 years, 11 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 (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 #include "chrome/renderer/chrome_render_thread_observer.h" 5 #include "chrome/renderer/chrome_render_thread_observer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 content::AssociatedInterfaceRegistry* associated_interfaces) { 288 content::AssociatedInterfaceRegistry* associated_interfaces) {
289 associated_interfaces->RemoveInterface( 289 associated_interfaces->RemoveInterface(
290 chrome::mojom::RendererConfiguration::Name_); 290 chrome::mojom::RendererConfiguration::Name_);
291 } 291 }
292 292
293 bool ChromeRenderThreadObserver::OnControlMessageReceived( 293 bool ChromeRenderThreadObserver::OnControlMessageReceived(
294 const IPC::Message& message) { 294 const IPC::Message& message) {
295 bool handled = true; 295 bool handled = true;
296 IPC_BEGIN_MESSAGE_MAP(ChromeRenderThreadObserver, message) 296 IPC_BEGIN_MESSAGE_MAP(ChromeRenderThreadObserver, message)
297 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup) 297 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup)
298 // TODO(nigeltao): delete this handler when all senders of
299 // ChromeViewMsg_SetContentSettingRules have been converted to Mojo.
298 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules, 300 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules,
299 OnSetContentSettingRules) 301 SetContentSettingRules)
300 IPC_MESSAGE_UNHANDLED(handled = false) 302 IPC_MESSAGE_UNHANDLED(handled = false)
301 IPC_END_MESSAGE_MAP() 303 IPC_END_MESSAGE_MAP()
302 return handled; 304 return handled;
303 } 305 }
304 306
305 void ChromeRenderThreadObserver::OnRenderProcessShutdown() { 307 void ChromeRenderThreadObserver::OnRenderProcessShutdown() {
306 visited_link_slave_.reset(); 308 visited_link_slave_.reset();
307 309
308 // Workaround for http://crbug.com/672646 310 // Workaround for http://crbug.com/672646
309 if (renderer_configuration_binding_.is_bound()) 311 if (renderer_configuration_binding_.is_bound())
310 renderer_configuration_binding_.Unbind(); 312 renderer_configuration_binding_.Unbind();
311 } 313 }
312 314
313 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( 315 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized(
314 const std::string& trial_name, 316 const std::string& trial_name,
315 const std::string& group_name) { 317 const std::string& group_name) {
316 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder; 318 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder;
317 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface( 319 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface(
318 &field_trial_recorder); 320 &field_trial_recorder);
319 field_trial_recorder->FieldTrialActivated(trial_name); 321 field_trial_recorder->FieldTrialActivated(trial_name);
320 } 322 }
321 323
322 void ChromeRenderThreadObserver::SetInitialConfiguration( 324 void ChromeRenderThreadObserver::SetInitialConfiguration(
323 bool is_incognito_process) { 325 bool is_incognito_process) {
324 is_incognito_process_ = is_incognito_process; 326 is_incognito_process_ = is_incognito_process;
325 } 327 }
326 328
329 void ChromeRenderThreadObserver::SetContentSettingRules(
330 const RendererContentSettingRules& rules) {
331 content_setting_rules_ = rules;
332 }
333
327 void ChromeRenderThreadObserver::OnRendererInterfaceRequest( 334 void ChromeRenderThreadObserver::OnRendererInterfaceRequest(
328 chrome::mojom::RendererConfigurationAssociatedRequest request) { 335 chrome::mojom::RendererConfigurationAssociatedRequest request) {
329 DCHECK(!renderer_configuration_binding_.is_bound()); 336 DCHECK(!renderer_configuration_binding_.is_bound());
330 renderer_configuration_binding_.Bind(std::move(request)); 337 renderer_configuration_binding_.Bind(std::move(request));
331 } 338 }
332 339
333 void ChromeRenderThreadObserver::OnSetContentSettingRules(
334 const RendererContentSettingRules& rules) {
335 content_setting_rules_ = rules;
336 }
337
338 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( 340 void ChromeRenderThreadObserver::OnSetFieldTrialGroup(
339 const std::string& trial_name, 341 const std::string& trial_name,
340 const std::string& group_name) { 342 const std::string& group_name) {
341 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); 343 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name);
342 } 344 }
343 345
344 const RendererContentSettingRules* 346 const RendererContentSettingRules*
345 ChromeRenderThreadObserver::content_setting_rules() const { 347 ChromeRenderThreadObserver::content_setting_rules() const {
346 return &content_setting_rules_; 348 return &content_setting_rules_;
347 } 349 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_thread_observer.h ('k') | components/content_settings/core/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698