| 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/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // maximum number of characters in the document to index, any text beyond this | 84 // maximum number of characters in the document to index, any text beyond this |
| 85 // point will be clipped | 85 // point will be clipped |
| 86 static const size_t kMaxIndexChars = 65535; | 86 static const size_t kMaxIndexChars = 65535; |
| 87 | 87 |
| 88 // Size of the thumbnails that we'll generate | 88 // Size of the thumbnails that we'll generate |
| 89 static const int kThumbnailWidth = 212; | 89 static const int kThumbnailWidth = 212; |
| 90 static const int kThumbnailHeight = 132; | 90 static const int kThumbnailHeight = 132; |
| 91 | 91 |
| 92 // Constants for UMA statistic collection. | 92 // Constants for UMA statistic collection. |
| 93 static const char kSSLInsecureContent[] = "SSL.InsecureContent"; | |
| 94 static const char kWWWDotGoogleDotCom[] = "www.google.com"; | 93 static const char kWWWDotGoogleDotCom[] = "www.google.com"; |
| 95 static const char kMailDotGoogleDotCom[] = "mail.google.com"; | 94 static const char kMailDotGoogleDotCom[] = "mail.google.com"; |
| 96 static const char kPlusDotGoogleDotCom[] = "plus.google.com"; | 95 static const char kPlusDotGoogleDotCom[] = "plus.google.com"; |
| 97 static const char kDocsDotGoogleDotCom[] = "docs.google.com"; | 96 static const char kDocsDotGoogleDotCom[] = "docs.google.com"; |
| 98 static const char kSitesDotGoogleDotCom[] = "sites.google.com"; | 97 static const char kSitesDotGoogleDotCom[] = "sites.google.com"; |
| 99 static const char kPicasawebDotGoogleDotCom[] = "picasaweb.google.com"; | 98 static const char kPicasawebDotGoogleDotCom[] = "picasaweb.google.com"; |
| 100 static const char kCodeDotGoogleDotCom[] = "code.google.com"; | 99 static const char kCodeDotGoogleDotCom[] = "code.google.com"; |
| 101 static const char kGroupsDotGoogleDotCom[] = "groups.google.com"; | 100 static const char kGroupsDotGoogleDotCom[] = "groups.google.com"; |
| 102 static const char kMapsDotGoogleDotCom[] = "maps.google.com"; | 101 static const char kMapsDotGoogleDotCom[] = "maps.google.com"; |
| 103 static const char kWWWDotYoutubeDotCom[] = "www.youtube.com"; | 102 static const char kWWWDotYoutubeDotCom[] = "www.youtube.com"; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( | 440 Send(new ChromeViewHostMsg_CanTriggerClipboardWrite( |
| 442 routing_id(), frame->document().url(), &allowed)); | 441 routing_id(), frame->document().url(), &allowed)); |
| 443 return allowed; | 442 return allowed; |
| 444 } | 443 } |
| 445 | 444 |
| 446 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( | 445 bool ChromeRenderViewObserver::allowDisplayingInsecureContent( |
| 447 WebKit::WebFrame* frame, | 446 WebKit::WebFrame* frame, |
| 448 bool allowed_per_settings, | 447 bool allowed_per_settings, |
| 449 const WebKit::WebSecurityOrigin& origin, | 448 const WebKit::WebSecurityOrigin& origin, |
| 450 const WebKit::WebURL& url) { | 449 const WebKit::WebURL& url) { |
| 451 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 450 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 452 INSECURE_CONTENT_DISPLAY, | 451 INSECURE_CONTENT_DISPLAY, |
| 453 INSECURE_CONTENT_NUM_EVENTS); | 452 INSECURE_CONTENT_NUM_EVENTS); |
| 454 std::string host(origin.host().utf8()); | 453 std::string host(origin.host().utf8()); |
| 455 GURL frame_url(frame->document().url()); | 454 GURL frame_url(frame->document().url()); |
| 456 if (isHostInDomain(host, kGoogleDotCom)) { | 455 if (isHostInDomain(host, kGoogleDotCom)) { |
| 457 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 456 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 458 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE, | 457 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE, |
| 459 INSECURE_CONTENT_NUM_EVENTS); | 458 INSECURE_CONTENT_NUM_EVENTS); |
| 460 if (StartsWithASCII(frame_url.path(), kGoogleSupportPathPrefix, false)) { | 459 if (StartsWithASCII(frame_url.path(), kGoogleSupportPathPrefix, false)) { |
| 461 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 460 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 462 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE_SUPPORT, | 461 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE_SUPPORT, |
| 463 INSECURE_CONTENT_NUM_EVENTS); | 462 INSECURE_CONTENT_NUM_EVENTS); |
| 464 } else if (StartsWithASCII(frame_url.path(), | 463 } else if (StartsWithASCII(frame_url.path(), |
| 465 kGoogleIntlPathPrefix, | 464 kGoogleIntlPathPrefix, |
| 466 false)) { | 465 false)) { |
| 467 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 466 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 468 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE_INTL, | 467 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE_INTL, |
| 469 INSECURE_CONTENT_NUM_EVENTS); | 468 INSECURE_CONTENT_NUM_EVENTS); |
| 470 } | 469 } |
| 471 } | 470 } |
| 472 if (host == kWWWDotGoogleDotCom) { | 471 if (host == kWWWDotGoogleDotCom) { |
| 473 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 472 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 474 INSECURE_CONTENT_DISPLAY_HOST_WWW_GOOGLE, | 473 INSECURE_CONTENT_DISPLAY_HOST_WWW_GOOGLE, |
| 475 INSECURE_CONTENT_NUM_EVENTS); | 474 INSECURE_CONTENT_NUM_EVENTS); |
| 476 if (StartsWithASCII(frame_url.path(), kGoogleReaderPathPrefix, false)) { | 475 if (StartsWithASCII(frame_url.path(), kGoogleReaderPathPrefix, false)) { |
| 477 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 476 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 478 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE_READER, | 477 INSECURE_CONTENT_DISPLAY_HOST_GOOGLE_READER, |
| 479 INSECURE_CONTENT_NUM_EVENTS); | 478 INSECURE_CONTENT_NUM_EVENTS); |
| 480 } | 479 } |
| 481 } else if (host == kMailDotGoogleDotCom) { | 480 } else if (host == kMailDotGoogleDotCom) { |
| 482 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 481 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 483 INSECURE_CONTENT_DISPLAY_HOST_MAIL_GOOGLE, | 482 INSECURE_CONTENT_DISPLAY_HOST_MAIL_GOOGLE, |
| 484 INSECURE_CONTENT_NUM_EVENTS); | 483 INSECURE_CONTENT_NUM_EVENTS); |
| 485 } else if (host == kPlusDotGoogleDotCom) { | 484 } else if (host == kPlusDotGoogleDotCom) { |
| 486 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 485 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 487 INSECURE_CONTENT_DISPLAY_HOST_PLUS_GOOGLE, | 486 INSECURE_CONTENT_DISPLAY_HOST_PLUS_GOOGLE, |
| 488 INSECURE_CONTENT_NUM_EVENTS); | 487 INSECURE_CONTENT_NUM_EVENTS); |
| 489 } else if (host == kDocsDotGoogleDotCom) { | 488 } else if (host == kDocsDotGoogleDotCom) { |
| 490 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 489 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 491 INSECURE_CONTENT_DISPLAY_HOST_DOCS_GOOGLE, | 490 INSECURE_CONTENT_DISPLAY_HOST_DOCS_GOOGLE, |
| 492 INSECURE_CONTENT_NUM_EVENTS); | 491 INSECURE_CONTENT_NUM_EVENTS); |
| 493 } else if (host == kSitesDotGoogleDotCom) { | 492 } else if (host == kSitesDotGoogleDotCom) { |
| 494 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 493 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 495 INSECURE_CONTENT_DISPLAY_HOST_SITES_GOOGLE, | 494 INSECURE_CONTENT_DISPLAY_HOST_SITES_GOOGLE, |
| 496 INSECURE_CONTENT_NUM_EVENTS); | 495 INSECURE_CONTENT_NUM_EVENTS); |
| 497 } else if (host == kPicasawebDotGoogleDotCom) { | 496 } else if (host == kPicasawebDotGoogleDotCom) { |
| 498 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 497 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 499 INSECURE_CONTENT_DISPLAY_HOST_PICASAWEB_GOOGLE, | 498 INSECURE_CONTENT_DISPLAY_HOST_PICASAWEB_GOOGLE, |
| 500 INSECURE_CONTENT_NUM_EVENTS); | 499 INSECURE_CONTENT_NUM_EVENTS); |
| 501 } else if (host == kCodeDotGoogleDotCom) { | 500 } else if (host == kCodeDotGoogleDotCom) { |
| 502 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 501 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 503 INSECURE_CONTENT_DISPLAY_HOST_CODE_GOOGLE, | 502 INSECURE_CONTENT_DISPLAY_HOST_CODE_GOOGLE, |
| 504 INSECURE_CONTENT_NUM_EVENTS); | 503 INSECURE_CONTENT_NUM_EVENTS); |
| 505 } else if (host == kGroupsDotGoogleDotCom) { | 504 } else if (host == kGroupsDotGoogleDotCom) { |
| 506 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 505 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 507 INSECURE_CONTENT_DISPLAY_HOST_GROUPS_GOOGLE, | 506 INSECURE_CONTENT_DISPLAY_HOST_GROUPS_GOOGLE, |
| 508 INSECURE_CONTENT_NUM_EVENTS); | 507 INSECURE_CONTENT_NUM_EVENTS); |
| 509 } else if (host == kMapsDotGoogleDotCom) { | 508 } else if (host == kMapsDotGoogleDotCom) { |
| 510 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 509 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 511 INSECURE_CONTENT_DISPLAY_HOST_MAPS_GOOGLE, | 510 INSECURE_CONTENT_DISPLAY_HOST_MAPS_GOOGLE, |
| 512 INSECURE_CONTENT_NUM_EVENTS); | 511 INSECURE_CONTENT_NUM_EVENTS); |
| 513 } else if (host == kWWWDotYoutubeDotCom) { | 512 } else if (host == kWWWDotYoutubeDotCom) { |
| 514 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 513 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 515 INSECURE_CONTENT_DISPLAY_HOST_YOUTUBE, | 514 INSECURE_CONTENT_DISPLAY_HOST_YOUTUBE, |
| 516 INSECURE_CONTENT_NUM_EVENTS); | 515 INSECURE_CONTENT_NUM_EVENTS); |
| 517 } | 516 } |
| 518 GURL gurl(url); | 517 GURL gurl(url); |
| 519 if (EndsWith(gurl.path(), kDotHTML, false)) { | 518 if (EndsWith(gurl.path(), kDotHTML, false)) { |
| 520 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 519 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 521 INSECURE_CONTENT_DISPLAY_HTML, | 520 INSECURE_CONTENT_DISPLAY_HTML, |
| 522 INSECURE_CONTENT_NUM_EVENTS); | 521 INSECURE_CONTENT_NUM_EVENTS); |
| 523 } | 522 } |
| 524 | 523 |
| 525 if (allowed_per_settings || allow_displaying_insecure_content_) | 524 if (allowed_per_settings || allow_displaying_insecure_content_) |
| 526 return true; | 525 return true; |
| 527 | 526 |
| 528 Send(new ChromeViewHostMsg_DidBlockDisplayingInsecureContent(routing_id())); | 527 Send(new ChromeViewHostMsg_DidBlockDisplayingInsecureContent(routing_id())); |
| 529 return false; | 528 return false; |
| 530 } | 529 } |
| 531 | 530 |
| 532 bool ChromeRenderViewObserver::allowRunningInsecureContent( | 531 bool ChromeRenderViewObserver::allowRunningInsecureContent( |
| 533 WebKit::WebFrame* frame, | 532 WebKit::WebFrame* frame, |
| 534 bool allowed_per_settings, | 533 bool allowed_per_settings, |
| 535 const WebKit::WebSecurityOrigin& origin, | 534 const WebKit::WebSecurityOrigin& origin, |
| 536 const WebKit::WebURL& url) { | 535 const WebKit::WebURL& url) { |
| 537 // Single value to control permissive mixed content behaviour. | 536 // Single value to control permissive mixed content behaviour. |
| 538 const bool enforce_insecure_content_on_all_domains = true; | 537 const bool enforce_insecure_content_on_all_domains = true; |
| 539 | 538 |
| 540 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 539 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 541 INSECURE_CONTENT_RUN, | 540 INSECURE_CONTENT_RUN, |
| 542 INSECURE_CONTENT_NUM_EVENTS); | 541 INSECURE_CONTENT_NUM_EVENTS); |
| 543 std::string host(origin.host().utf8()); | 542 std::string host(origin.host().utf8()); |
| 544 GURL frame_url(frame->document().url()); | 543 GURL frame_url(frame->document().url()); |
| 545 bool is_google = isHostInDomain(host, kGoogleDotCom); | 544 bool is_google = isHostInDomain(host, kGoogleDotCom); |
| 546 if (is_google) { | 545 if (is_google) { |
| 547 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 546 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 548 INSECURE_CONTENT_RUN_HOST_GOOGLE, | 547 INSECURE_CONTENT_RUN_HOST_GOOGLE, |
| 549 INSECURE_CONTENT_NUM_EVENTS); | 548 INSECURE_CONTENT_NUM_EVENTS); |
| 550 if (StartsWithASCII(frame_url.path(), kGoogleSupportPathPrefix, false)) { | 549 if (StartsWithASCII(frame_url.path(), kGoogleSupportPathPrefix, false)) { |
| 551 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 550 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 552 INSECURE_CONTENT_RUN_HOST_GOOGLE_SUPPORT, | 551 INSECURE_CONTENT_RUN_HOST_GOOGLE_SUPPORT, |
| 553 INSECURE_CONTENT_NUM_EVENTS); | 552 INSECURE_CONTENT_NUM_EVENTS); |
| 554 } else if (StartsWithASCII(frame_url.path(), | 553 } else if (StartsWithASCII(frame_url.path(), |
| 555 kGoogleIntlPathPrefix, | 554 kGoogleIntlPathPrefix, |
| 556 false)) { | 555 false)) { |
| 557 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 556 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 558 INSECURE_CONTENT_RUN_HOST_GOOGLE_INTL, | 557 INSECURE_CONTENT_RUN_HOST_GOOGLE_INTL, |
| 559 INSECURE_CONTENT_NUM_EVENTS); | 558 INSECURE_CONTENT_NUM_EVENTS); |
| 560 } | 559 } |
| 561 } | 560 } |
| 562 if (host == kWWWDotGoogleDotCom) { | 561 if (host == kWWWDotGoogleDotCom) { |
| 563 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 562 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 564 INSECURE_CONTENT_RUN_HOST_WWW_GOOGLE, | 563 INSECURE_CONTENT_RUN_HOST_WWW_GOOGLE, |
| 565 INSECURE_CONTENT_NUM_EVENTS); | 564 INSECURE_CONTENT_NUM_EVENTS); |
| 566 if (StartsWithASCII(frame_url.path(), kGoogleReaderPathPrefix, false)) { | 565 if (StartsWithASCII(frame_url.path(), kGoogleReaderPathPrefix, false)) { |
| 567 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 566 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 568 INSECURE_CONTENT_RUN_HOST_GOOGLE_READER, | 567 INSECURE_CONTENT_RUN_HOST_GOOGLE_READER, |
| 569 INSECURE_CONTENT_NUM_EVENTS); | 568 INSECURE_CONTENT_NUM_EVENTS); |
| 570 } | 569 } |
| 571 } else if (host == kMailDotGoogleDotCom) { | 570 } else if (host == kMailDotGoogleDotCom) { |
| 572 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 571 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 573 INSECURE_CONTENT_RUN_HOST_MAIL_GOOGLE, | 572 INSECURE_CONTENT_RUN_HOST_MAIL_GOOGLE, |
| 574 INSECURE_CONTENT_NUM_EVENTS); | 573 INSECURE_CONTENT_NUM_EVENTS); |
| 575 } else if (host == kPlusDotGoogleDotCom) { | 574 } else if (host == kPlusDotGoogleDotCom) { |
| 576 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 575 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 577 INSECURE_CONTENT_RUN_HOST_PLUS_GOOGLE, | 576 INSECURE_CONTENT_RUN_HOST_PLUS_GOOGLE, |
| 578 INSECURE_CONTENT_NUM_EVENTS); | 577 INSECURE_CONTENT_NUM_EVENTS); |
| 579 } else if (host == kDocsDotGoogleDotCom) { | 578 } else if (host == kDocsDotGoogleDotCom) { |
| 580 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 579 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 581 INSECURE_CONTENT_RUN_HOST_DOCS_GOOGLE, | 580 INSECURE_CONTENT_RUN_HOST_DOCS_GOOGLE, |
| 582 INSECURE_CONTENT_NUM_EVENTS); | 581 INSECURE_CONTENT_NUM_EVENTS); |
| 583 } else if (host == kSitesDotGoogleDotCom) { | 582 } else if (host == kSitesDotGoogleDotCom) { |
| 584 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 583 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 585 INSECURE_CONTENT_RUN_HOST_SITES_GOOGLE, | 584 INSECURE_CONTENT_RUN_HOST_SITES_GOOGLE, |
| 586 INSECURE_CONTENT_NUM_EVENTS); | 585 INSECURE_CONTENT_NUM_EVENTS); |
| 587 } else if (host == kPicasawebDotGoogleDotCom) { | 586 } else if (host == kPicasawebDotGoogleDotCom) { |
| 588 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 587 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 589 INSECURE_CONTENT_RUN_HOST_PICASAWEB_GOOGLE, | 588 INSECURE_CONTENT_RUN_HOST_PICASAWEB_GOOGLE, |
| 590 INSECURE_CONTENT_NUM_EVENTS); | 589 INSECURE_CONTENT_NUM_EVENTS); |
| 591 } else if (host == kCodeDotGoogleDotCom) { | 590 } else if (host == kCodeDotGoogleDotCom) { |
| 592 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 591 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 593 INSECURE_CONTENT_RUN_HOST_CODE_GOOGLE, | 592 INSECURE_CONTENT_RUN_HOST_CODE_GOOGLE, |
| 594 INSECURE_CONTENT_NUM_EVENTS); | 593 INSECURE_CONTENT_NUM_EVENTS); |
| 595 } else if (host == kGroupsDotGoogleDotCom) { | 594 } else if (host == kGroupsDotGoogleDotCom) { |
| 596 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 595 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 597 INSECURE_CONTENT_RUN_HOST_GROUPS_GOOGLE, | 596 INSECURE_CONTENT_RUN_HOST_GROUPS_GOOGLE, |
| 598 INSECURE_CONTENT_NUM_EVENTS); | 597 INSECURE_CONTENT_NUM_EVENTS); |
| 599 } else if (host == kMapsDotGoogleDotCom) { | 598 } else if (host == kMapsDotGoogleDotCom) { |
| 600 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 599 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 601 INSECURE_CONTENT_RUN_HOST_MAPS_GOOGLE, | 600 INSECURE_CONTENT_RUN_HOST_MAPS_GOOGLE, |
| 602 INSECURE_CONTENT_NUM_EVENTS); | 601 INSECURE_CONTENT_NUM_EVENTS); |
| 603 } else if (host == kWWWDotYoutubeDotCom) { | 602 } else if (host == kWWWDotYoutubeDotCom) { |
| 604 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 603 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 605 INSECURE_CONTENT_RUN_HOST_YOUTUBE, | 604 INSECURE_CONTENT_RUN_HOST_YOUTUBE, |
| 606 INSECURE_CONTENT_NUM_EVENTS); | 605 INSECURE_CONTENT_NUM_EVENTS); |
| 607 } else if (EndsWith(host, kDotGoogleUserContentDotCom, false)) { | 606 } else if (EndsWith(host, kDotGoogleUserContentDotCom, false)) { |
| 608 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 607 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 609 INSECURE_CONTENT_RUN_HOST_GOOGLEUSERCONTENT, | 608 INSECURE_CONTENT_RUN_HOST_GOOGLEUSERCONTENT, |
| 610 INSECURE_CONTENT_NUM_EVENTS); | 609 INSECURE_CONTENT_NUM_EVENTS); |
| 611 } | 610 } |
| 612 GURL gurl(url); | 611 GURL gurl(url); |
| 613 if (gurl.host() == kWWWDotYoutubeDotCom) { | 612 if (gurl.host() == kWWWDotYoutubeDotCom) { |
| 614 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 613 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 615 INSECURE_CONTENT_RUN_TARGET_YOUTUBE, | 614 INSECURE_CONTENT_RUN_TARGET_YOUTUBE, |
| 616 INSECURE_CONTENT_NUM_EVENTS); | 615 INSECURE_CONTENT_NUM_EVENTS); |
| 617 } | 616 } |
| 618 if (EndsWith(gurl.path(), kDotJS, false)) { | 617 if (EndsWith(gurl.path(), kDotJS, false)) { |
| 619 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 618 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 620 INSECURE_CONTENT_RUN_JS, | 619 INSECURE_CONTENT_RUN_JS, |
| 621 INSECURE_CONTENT_NUM_EVENTS); | 620 INSECURE_CONTENT_NUM_EVENTS); |
| 622 } else if (EndsWith(gurl.path(), kDotCSS, false)) { | 621 } else if (EndsWith(gurl.path(), kDotCSS, false)) { |
| 623 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 622 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 624 INSECURE_CONTENT_RUN_CSS, | 623 INSECURE_CONTENT_RUN_CSS, |
| 625 INSECURE_CONTENT_NUM_EVENTS); | 624 INSECURE_CONTENT_NUM_EVENTS); |
| 626 } else if (EndsWith(gurl.path(), kDotSWF, false)) { | 625 } else if (EndsWith(gurl.path(), kDotSWF, false)) { |
| 627 UMA_HISTOGRAM_ENUMERATION(kSSLInsecureContent, | 626 UMA_HISTOGRAM_ENUMERATION("SSL.InsecureContent", |
| 628 INSECURE_CONTENT_RUN_SWF, | 627 INSECURE_CONTENT_RUN_SWF, |
| 629 INSECURE_CONTENT_NUM_EVENTS); | 628 INSECURE_CONTENT_NUM_EVENTS); |
| 630 } | 629 } |
| 631 | 630 |
| 632 if (allow_running_insecure_content_ || allowed_per_settings) | 631 if (allow_running_insecure_content_ || allowed_per_settings) |
| 633 return true; | 632 return true; |
| 634 | 633 |
| 635 if (!(enforce_insecure_content_on_all_domains || | 634 if (!(enforce_insecure_content_on_all_domains || |
| 636 CommandLine::ForCurrentProcess()->HasSwitch( | 635 CommandLine::ForCurrentProcess()->HasSwitch( |
| 637 switches::kNoRunningInsecureContent))) { | 636 switches::kNoRunningInsecureContent))) { |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 // Decode the favicon using WebKit's image decoder. | 1085 // Decode the favicon using WebKit's image decoder. |
| 1087 webkit_glue::ImageDecoder decoder( | 1086 webkit_glue::ImageDecoder decoder( |
| 1088 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); | 1087 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize)); |
| 1089 const unsigned char* src_data = | 1088 const unsigned char* src_data = |
| 1090 reinterpret_cast<const unsigned char*>(&data[0]); | 1089 reinterpret_cast<const unsigned char*>(&data[0]); |
| 1091 | 1090 |
| 1092 return decoder.Decode(src_data, data.size()); | 1091 return decoder.Decode(src_data, data.size()); |
| 1093 } | 1092 } |
| 1094 return SkBitmap(); | 1093 return SkBitmap(); |
| 1095 } | 1094 } |
| OLD | NEW |