| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/chrome_render_message_filter.h" | 5 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "chrome/browser/automation/automation_resource_message_filter.h" | 9 #include "chrome/browser/automation/automation_resource_message_filter.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 url, CONTENT_SETTINGS_TYPE_COOKIES, ""); | 352 url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 353 *allowed = setting != CONTENT_SETTING_BLOCK; | 353 *allowed = setting != CONTENT_SETTING_BLOCK; |
| 354 // If content was blocked, tell the UI to display the blocked content icon. | 354 // If content was blocked, tell the UI to display the blocked content icon. |
| 355 BrowserThread::PostTask( | 355 BrowserThread::PostTask( |
| 356 BrowserThread::UI, FROM_HERE, | 356 BrowserThread::UI, FROM_HERE, |
| 357 NewRunnableFunction( | 357 NewRunnableFunction( |
| 358 &TabSpecificContentSettings::DOMStorageAccessed, | 358 &TabSpecificContentSettings::DOMStorageAccessed, |
| 359 render_process_id_, render_view_id, url, type, !*allowed)); | 359 render_process_id_, render_view_id, url, type, !*allowed)); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void ChromeRenderMessageFilter::OnAllowFileSystem(int render_view_id, |
| 363 const GURL& url, |
| 364 bool* allowed) { |
| 365 |
| 366 // TODO(kinuko): Need to notify the UI thread to indicate that |
| 367 // there's a blocked content. See the above for inspiration. |
| 368 ContentSetting setting = host_content_settings_map_->GetContentSetting( |
| 369 url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 370 DCHECK((setting == CONTENT_SETTING_ALLOW) || |
| 371 (setting == CONTENT_SETTING_BLOCK) || |
| 372 (setting == CONTENT_SETTING_SESSION_ONLY)); |
| 373 *allowed = setting != CONTENT_SETTING_BLOCK; |
| 374 } |
| 375 |
| 362 void ChromeRenderMessageFilter::OnAllowIndexedDB(int render_view_id, | 376 void ChromeRenderMessageFilter::OnAllowIndexedDB(int render_view_id, |
| 363 const string16& origin_url, | 377 const string16& origin_url, |
| 364 const string16& name, | 378 const string16& name, |
| 365 bool* allowed) { | 379 bool* allowed) { |
| 366 // TODO(jochen): This doesn't support file:/// urls properly. We probably need | 380 // TODO(jochen): This doesn't support file:/// urls properly. We probably need |
| 367 // to add some toString method to WebSecurityOrigin that doesn't | 381 // to add some toString method to WebSecurityOrigin that doesn't |
| 368 // return null for them. | 382 // return null for them. |
| 369 WebSecurityOrigin origin( | 383 WebSecurityOrigin origin( |
| 370 WebSecurityOrigin::createFromDatabaseIdentifier(origin_url)); | 384 WebSecurityOrigin::createFromDatabaseIdentifier(origin_url)); |
| 371 GURL url(origin.toString()); | 385 GURL url(origin.toString()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 reply_msg, url); | 423 reply_msg, url); |
| 410 } | 424 } |
| 411 | 425 |
| 412 void ChromeRenderMessageFilter::OnSetCookie(const IPC::Message& message, | 426 void ChromeRenderMessageFilter::OnSetCookie(const IPC::Message& message, |
| 413 const GURL& url, | 427 const GURL& url, |
| 414 const GURL& first_party_for_cookies, | 428 const GURL& first_party_for_cookies, |
| 415 const std::string& cookie) { | 429 const std::string& cookie) { |
| 416 AutomationResourceMessageFilter::SetCookiesForUrl( | 430 AutomationResourceMessageFilter::SetCookiesForUrl( |
| 417 render_process_id_, message.routing_id(), url, cookie); | 431 render_process_id_, message.routing_id(), url, cookie); |
| 418 } | 432 } |
| OLD | NEW |