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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 void ChromeRenderViewObserver::OnSetWindowFeatures( | 346 void ChromeRenderViewObserver::OnSetWindowFeatures( |
347 const WebWindowFeatures& window_features) { | 347 const WebWindowFeatures& window_features) { |
348 render_view()->GetWebView()->setWindowFeatures(window_features); | 348 render_view()->GetWebView()->setWindowFeatures(window_features); |
349 } | 349 } |
350 | 350 |
351 void ChromeRenderViewObserver::Navigate(const GURL& url) { | 351 void ChromeRenderViewObserver::Navigate(const GURL& url) { |
352 // Execute cache clear operations that were postponed until a navigation | 352 // Execute cache clear operations that were postponed until a navigation |
353 // event (including tab reload). | 353 // event (including tab reload). |
354 if (chrome_render_process_observer_) | 354 if (chrome_render_process_observer_) |
355 chrome_render_process_observer_->ExecutePendingClearCache(); | 355 chrome_render_process_observer_->ExecutePendingClearCache(); |
| 356 // Let translate_helper do any preparatory work for loading a URL. |
| 357 if (translate_helper_) |
| 358 translate_helper_->PrepareForUrl(url); |
356 } | 359 } |
357 | 360 |
358 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( | 361 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( |
359 bool enable_phishing_detection) { | 362 bool enable_phishing_detection) { |
360 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) | 363 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) |
361 phishing_classifier_ = enable_phishing_detection ? | 364 phishing_classifier_ = enable_phishing_detection ? |
362 safe_browsing::PhishingClassifierDelegate::Create( | 365 safe_browsing::PhishingClassifierDelegate::Create( |
363 render_view(), NULL) : | 366 render_view(), NULL) : |
364 NULL; | 367 NULL; |
365 #endif | 368 #endif |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 WebElement element = node.to<WebElement>(); | 592 WebElement element = node.to<WebElement>(); |
590 if (!element.hasTagName(tag_name)) | 593 if (!element.hasTagName(tag_name)) |
591 continue; | 594 continue; |
592 WebString value = element.getAttribute(attribute_name); | 595 WebString value = element.getAttribute(attribute_name); |
593 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 596 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
594 continue; | 597 continue; |
595 return true; | 598 return true; |
596 } | 599 } |
597 return false; | 600 return false; |
598 } | 601 } |
OLD | NEW |