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 #include "chrome/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 void ChromeRenderViewObserver::OnSetWindowFeatures( | 353 void ChromeRenderViewObserver::OnSetWindowFeatures( |
354 const WebWindowFeatures& window_features) { | 354 const WebWindowFeatures& window_features) { |
355 render_view()->GetWebView()->setWindowFeatures(window_features); | 355 render_view()->GetWebView()->setWindowFeatures(window_features); |
356 } | 356 } |
357 | 357 |
358 void ChromeRenderViewObserver::Navigate(const GURL& url) { | 358 void ChromeRenderViewObserver::Navigate(const GURL& url) { |
359 // Execute cache clear operations that were postponed until a navigation | 359 // Execute cache clear operations that were postponed until a navigation |
360 // event (including tab reload). | 360 // event (including tab reload). |
361 if (chrome_render_process_observer_) | 361 if (chrome_render_process_observer_) |
362 chrome_render_process_observer_->ExecutePendingClearCache(); | 362 chrome_render_process_observer_->ExecutePendingClearCache(); |
| 363 // Let translate_helper do any preparatory work for loading a URL. |
| 364 if (translate_helper_) |
| 365 translate_helper_->PrepareForUrl(url); |
363 } | 366 } |
364 | 367 |
365 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( | 368 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( |
366 bool enable_phishing_detection) { | 369 bool enable_phishing_detection) { |
367 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) | 370 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) |
368 phishing_classifier_ = enable_phishing_detection ? | 371 phishing_classifier_ = enable_phishing_detection ? |
369 safe_browsing::PhishingClassifierDelegate::Create( | 372 safe_browsing::PhishingClassifierDelegate::Create( |
370 render_view(), NULL) : | 373 render_view(), NULL) : |
371 NULL; | 374 NULL; |
372 #endif | 375 #endif |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 WebElement element = node.to<WebElement>(); | 602 WebElement element = node.to<WebElement>(); |
600 if (!element.hasTagName(tag_name)) | 603 if (!element.hasTagName(tag_name)) |
601 continue; | 604 continue; |
602 WebString value = element.getAttribute(attribute_name); | 605 WebString value = element.getAttribute(attribute_name); |
603 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 606 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
604 continue; | 607 continue; |
605 return true; | 608 return true; |
606 } | 609 } |
607 return false; | 610 return false; |
608 } | 611 } |
OLD | NEW |