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

Side by Side Diff: chrome/browser/metrics/variations/generated_resources_map_lookup.cc

Issue 1363243004: Allow embedders to share code to override UI strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment to test and class and fix typo Created 5 years, 2 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/metrics/variations/generated_resources_map.h"
6
7 #include <algorithm>
8
9 namespace chrome_variations {
10
11 int GetResourceIndex(uint32_t hash) {
12 const uint32_t* kEnd = kResourceHashes + kNumResources;
13 const uint32_t* element = std::lower_bound(kResourceHashes, kEnd, hash);
14
15 if (element == kEnd || *element != hash)
16 return -1;
17 return kResourceIndices[element - kResourceHashes];
18 }
19
20 } // namespace chrome_variations
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698