diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 17:38:19 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 17:38:19 +0000 |
commit | cf3f387e6dd8072cb884964923e978bb198bca12 (patch) | |
tree | 358fbdcfc310baba78a7b87bfc48a4a402ae968e /chrome/browser/tab_contents/tab_contents.cc | |
parent | ae1b251286512eded9ff13561ea84a645878859b (diff) | |
download | chromium_src-cf3f387e6dd8072cb884964923e978bb198bca12.zip chromium_src-cf3f387e6dd8072cb884964923e978bb198bca12.tar.gz chromium_src-cf3f387e6dd8072cb884964923e978bb198bca12.tar.bz2 |
Revert 36362 - It breaks NACLTests and Chrome Frame Tests
3rd attempt at landing the language detection on page load.
A memory error has been fixed in the CLD library in the meantime.
This should hopefully fixes the crashers in the reliability tests.
Note that this version is actually simpler than the original review since the detection is now performed in the renderer. (So the CLD code runs sandboxed.)
Original review:
http://codereview.chromium.org/492024/show
BUG=30662
TEST=Run the unittests.
Review URL: http://codereview.chromium.org/518075
TBR=jcampan@chromium.org
Review URL: http://codereview.chromium.org/546062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/tab_contents.cc')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index bf0bd56..10efa22 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -1076,6 +1076,10 @@ void TabContents::StopFinding(bool clear_selection) { render_view_host()->StopFinding(clear_selection); } +void TabContents::GetPageLanguage() { + render_view_host()->GetPageLanguage(); +} + void TabContents::OnSavePage() { // If we can not save the page, try to download it. if (!SavePackage::IsSavableContents(contents_mime_type())) { @@ -1731,39 +1735,6 @@ void TabContents::OnDidGetApplicationInfo( delegate()->OnDidGetApplicationInfo(this, page_id); } -void TabContents::OnPageContents(const GURL& url, - int renderer_process_id, - int32 page_id, - const std::wstring& contents, - const std::string& language) { - // Don't index any https pages. People generally don't want their bank - // accounts, etc. indexed on their computer, especially since some of these - // things are not marked cachable. - // TODO(brettw) we may want to consider more elaborate heuristics such as - // the cachability of the page. We may also want to consider subframes (this - // test will still index subframes if the subframe is SSL). - if (!url.SchemeIsSecure()) { - Profile* p = profile(); - if (p && !p->IsOffTheRecord()) { - HistoryService* hs = p->GetHistoryService(Profile::IMPLICIT_ACCESS); - if (hs) - hs->SetPageContents(url, contents); - } - } - - NavigationEntry* entry = controller_.GetActiveEntry(); - if (process()->id() == renderer_process_id && - entry && entry->page_id() == page_id) { - entry->set_language(language); - } - - std::string lang = language; - NotificationService::current()->Notify( - NotificationType::TAB_LANGUAGE_DETERMINED, - Source<RenderViewHost>(render_view_host()), - Details<std::string>(&lang)); -} - void TabContents::DidStartProvisionalLoadForFrame( RenderViewHost* render_view_host, bool is_main_frame, |