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

Side by Side Diff: chrome/browser/pdf/pdf_extension_util.cc

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 6 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/pdf/pdf_extension_util.h" 5 #include "chrome/browser/pdf/pdf_extension_util.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "chrome/common/chrome_content_client.h" 8 #include "chrome/common/chrome_content_client.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/grit/browser_resources.h" 10 #include "chrome/grit/browser_resources.h"
(...skipping 20 matching lines...) Expand all
31 const char kPdfResourceIdentifier[] = "google-chrome-pdf"; 31 const char kPdfResourceIdentifier[] = "google-chrome-pdf";
32 #else 32 #else
33 const char kPdfResourceIdentifier[] = "chromium-pdf"; 33 const char kPdfResourceIdentifier[] = "chromium-pdf";
34 #endif 34 #endif
35 35
36 std::string GetManifest() { 36 std::string GetManifest() {
37 std::string manifest_contents = 37 std::string manifest_contents =
38 ResourceBundle::GetSharedInstance().GetRawDataResource( 38 ResourceBundle::GetSharedInstance().GetRawDataResource(
39 IDR_PDF_MANIFEST).as_string(); 39 IDR_PDF_MANIFEST).as_string();
40 DCHECK(manifest_contents.find(kNameTag) != std::string::npos); 40 DCHECK(manifest_contents.find(kNameTag) != std::string::npos);
41 ReplaceFirstSubstringAfterOffset( 41 base::ReplaceFirstSubstringAfterOffset(
42 &manifest_contents, 0, kNameTag, ChromeContentClient::kPDFPluginName); 42 &manifest_contents, 0, kNameTag, ChromeContentClient::kPDFPluginName);
43 43
44 DCHECK(manifest_contents.find(kIndexTag) != std::string::npos); 44 DCHECK(manifest_contents.find(kIndexTag) != std::string::npos);
45 std::string index = switches::PdfMaterialUIEnabled() ? 45 std::string index = switches::PdfMaterialUIEnabled() ?
46 kMaterialIndex : kRegularIndex; 46 kMaterialIndex : kRegularIndex;
47 ReplaceSubstringsAfterOffset(&manifest_contents, 0, kIndexTag, index); 47 base::ReplaceSubstringsAfterOffset(&manifest_contents, 0, kIndexTag, index);
48 return manifest_contents; 48 return manifest_contents;
49 } 49 }
50 50
51 } // namespace pdf_extension_util 51 } // namespace pdf_extension_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698