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

Side by Side Diff: chrome/browser/chromeos/chromeos_utils.cc

Issue 1220963005: Update base::StartsWith calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: Created 5 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/chromeos_utils.h" 5 #include "chrome/browser/chromeos/chromeos_utils.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "chrome/grit/generated_resources.h" 9 #include "chrome/grit/generated_resources.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 } // namespace chrome_device_types 47 } // namespace chrome_device_types
48 48
49 base::string16 GetChromeDeviceType() { 49 base::string16 GetChromeDeviceType() {
50 return l10n_util::GetStringUTF16(GetChromeDeviceTypeResourceId()); 50 return l10n_util::GetStringUTF16(GetChromeDeviceTypeResourceId());
51 } 51 }
52 52
53 int GetChromeDeviceTypeResourceId() { 53 int GetChromeDeviceTypeResourceId() {
54 const std::string board = base::SysInfo::GetLsbReleaseBoard(); 54 const std::string board = base::SysInfo::GetLsbReleaseBoard();
55 for (size_t i = 0; i < arraysize(kChromeboxBoards); ++i) { 55 for (size_t i = 0; i < arraysize(kChromeboxBoards); ++i) {
56 if (base::StartsWithASCII(board, kChromeboxBoards[i], true)) 56 if (base::StartsWith(board, kChromeboxBoards[i],
57 base::CompareCase::SENSITIVE))
57 return IDS_CHROMEBOX; 58 return IDS_CHROMEBOX;
58 } 59 }
59 for (size_t i = 0; i < arraysize(kChromebaseBoards); ++i) { 60 for (size_t i = 0; i < arraysize(kChromebaseBoards); ++i) {
60 if (base::StartsWithASCII(board, kChromebaseBoards[i], true)) 61 if (base::StartsWith(board, kChromebaseBoards[i],
62 base::CompareCase::SENSITIVE))
61 return IDS_CHROMEBASE; 63 return IDS_CHROMEBASE;
62 } 64 }
63 for (size_t i = 0; i < arraysize(kChromebitBoards); ++i) { 65 for (size_t i = 0; i < arraysize(kChromebitBoards); ++i) {
64 if (base::StartsWithASCII(board, kChromebitBoards[i], true)) 66 if (base::StartsWith(board, kChromebitBoards[i],
67 base::CompareCase::SENSITIVE))
65 return IDS_CHROMEBIT; 68 return IDS_CHROMEBIT;
66 } 69 }
67 return IDS_CHROMEBOOK; 70 return IDS_CHROMEBOOK;
68 } 71 }
69 72
70 std::string GetChromeDeviceTypeString() { 73 std::string GetChromeDeviceTypeString() {
71 int resource_id = GetChromeDeviceTypeResourceId(); 74 int resource_id = GetChromeDeviceTypeResourceId();
72 switch (resource_id) { 75 switch (resource_id) {
73 case IDS_CHROMEBOX: 76 case IDS_CHROMEBOX:
74 return chrome_device_types::kChromebox; 77 return chrome_device_types::kChromebox;
75 case IDS_CHROMEBASE: 78 case IDS_CHROMEBASE:
76 return chrome_device_types::kChromebase; 79 return chrome_device_types::kChromebase;
77 case IDS_CHROMEBIT: 80 case IDS_CHROMEBIT:
78 return chrome_device_types::kChromebit; 81 return chrome_device_types::kChromebit;
79 default: 82 default:
80 NOTREACHED() << "Unknown Chrome device type: " << resource_id; 83 NOTREACHED() << "Unknown Chrome device type: " << resource_id;
81 case IDS_CHROMEBOOK: 84 case IDS_CHROMEBOOK:
82 return chrome_device_types::kChromebook; 85 return chrome_device_types::kChromebook;
83 } 86 }
84 } 87 }
85 88
86 } // namespace chromeos 89 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698