Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: content/browser/download/download_item.cc

Issue 8475024: Changed argument to GetAcceptLangs() to a BrowserContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "content/browser/download/download_item.h" 5 #include "content/browser/download/download_item.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 if (base::i18n::StringSearchIgnoringCaseAndAccents(query, url_raw)) 637 if (base::i18n::StringSearchIgnoringCaseAndAccents(query, url_raw))
638 return true; 638 return true;
639 639
640 // TODO(phajdan.jr): write a test case for the following code. 640 // TODO(phajdan.jr): write a test case for the following code.
641 // A good test case would be: 641 // A good test case would be:
642 // "/\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xbd\xa0\xe5\xa5\xbd", 642 // "/\xe4\xbd\xa0\xe5\xa5\xbd\xe4\xbd\xa0\xe5\xa5\xbd",
643 // L"/\x4f60\x597d\x4f60\x597d", 643 // L"/\x4f60\x597d\x4f60\x597d",
644 // "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD" 644 // "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD"
645 std::string languages; 645 std::string languages;
646 TabContents* tab = request_handle_->GetTabContents(); 646 TabContents* tab = request_handle_->GetTabContents();
647 if (tab) 647 if (tab)
jam 2011/11/07 16:56:39 nit: add brace brackets now
648 languages = content::GetContentClient()->browser()->GetAcceptLangs(tab); 648 languages = content::GetContentClient()->browser()->GetAcceptLangs(
649 tab->browser_context());
649 string16 url_formatted(net::FormatUrl(GetURL(), languages)); 650 string16 url_formatted(net::FormatUrl(GetURL(), languages));
650 if (base::i18n::StringSearchIgnoringCaseAndAccents(query, url_formatted)) 651 if (base::i18n::StringSearchIgnoringCaseAndAccents(query, url_formatted))
651 return true; 652 return true;
652 653
653 string16 path(full_path().LossyDisplayName()); 654 string16 path(full_path().LossyDisplayName());
654 return base::i18n::StringSearchIgnoringCaseAndAccents(query, path); 655 return base::i18n::StringSearchIgnoringCaseAndAccents(query, path);
655 } 656 }
656 657
657 void DownloadItem::SetFileCheckResults(const DownloadStateInfo& state) { 658 void DownloadItem::SetFileCheckResults(const DownloadStateInfo& state) {
658 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. 659 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved.
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 state_info_.target_name.value().c_str(), 819 state_info_.target_name.value().c_str(),
819 full_path().value().c_str()); 820 full_path().value().c_str());
820 } else { 821 } else {
821 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); 822 description += base::StringPrintf(" url = \"%s\"", url_list.c_str());
822 } 823 }
823 824
824 description += " }"; 825 description += " }";
825 826
826 return description; 827 return description;
827 } 828 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698