2016-11-18 00:52:42 +01:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
#include "tests/cefclient/browser/resource.h"
|
|
|
|
|
|
|
|
namespace client {
|
|
|
|
|
|
|
|
int GetResourceId(const char* resource_name) {
|
|
|
|
// Map of resource labels to BINARY id values.
|
|
|
|
static struct _resource_map {
|
2017-12-07 22:44:24 +01:00
|
|
|
const char* name;
|
2016-11-18 00:52:42 +01:00
|
|
|
int id;
|
|
|
|
} resource_map[] = {
|
2017-05-17 11:29:28 +02:00
|
|
|
{"binding.html", IDS_BINDING_HTML},
|
|
|
|
{"dialogs.html", IDS_DIALOGS_HTML},
|
|
|
|
{"draggable.html", IDS_DRAGGABLE_HTML},
|
2017-08-04 00:55:19 +02:00
|
|
|
{"extensions/set_page_color/icon.png",
|
|
|
|
IDS_EXTENSIONS_SET_PAGE_COLOR_ICON_PNG},
|
|
|
|
{"extensions/set_page_color/manifest.json",
|
|
|
|
IDS_EXTENSIONS_SET_PAGE_COLOR_MANIFEST_JSON},
|
|
|
|
{"extensions/set_page_color/popup.html",
|
|
|
|
IDS_EXTENSIONS_SET_PAGE_COLOR_POPUP_HTML},
|
|
|
|
{"extensions/set_page_color/popup.js",
|
|
|
|
IDS_EXTENSIONS_SET_PAGE_COLOR_POPUP_JS},
|
2017-05-17 11:29:28 +02:00
|
|
|
{"localstorage.html", IDS_LOCALSTORAGE_HTML},
|
2020-03-19 16:34:15 +01:00
|
|
|
{"logo.png", IDS_LOGO_PNG},
|
|
|
|
{"media_router.html", IDS_MEDIA_ROUTER_HTML},
|
2017-05-17 11:29:28 +02:00
|
|
|
{"menu_icon.1x.png", IDS_MENU_ICON_1X_PNG},
|
|
|
|
{"menu_icon.2x.png", IDS_MENU_ICON_2X_PNG},
|
|
|
|
{"osr_test.html", IDS_OSRTEST_HTML},
|
|
|
|
{"other_tests.html", IDS_OTHER_TESTS_HTML},
|
|
|
|
{"pdf.html", IDS_PDF_HTML},
|
|
|
|
{"pdf.pdf", IDS_PDF_PDF},
|
|
|
|
{"performance.html", IDS_PERFORMANCE_HTML},
|
|
|
|
{"performance2.html", IDS_PERFORMANCE2_HTML},
|
|
|
|
{"preferences.html", IDS_PREFERENCES_HTML},
|
|
|
|
{"response_filter.html", IDS_RESPONSE_FILTER_HTML},
|
2017-11-09 20:00:47 +01:00
|
|
|
{"server.html", IDS_SERVER_HTML},
|
2017-05-17 11:29:28 +02:00
|
|
|
{"transparency.html", IDS_TRANSPARENCY_HTML},
|
|
|
|
{"urlrequest.html", IDS_URLREQUEST_HTML},
|
2017-11-09 20:00:47 +01:00
|
|
|
{"websocket.html", IDS_WEBSOCKET_HTML},
|
2017-05-17 11:29:28 +02:00
|
|
|
{"window.html", IDS_WINDOW_HTML},
|
|
|
|
{"window_icon.1x.png", IDS_WINDOW_ICON_1X_PNG},
|
|
|
|
{"window_icon.2x.png", IDS_WINDOW_ICON_2X_PNG},
|
|
|
|
{"xmlhttprequest.html", IDS_XMLHTTPREQUEST_HTML},
|
2016-11-18 00:52:42 +01:00
|
|
|
};
|
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
for (size_t i = 0; i < sizeof(resource_map) / sizeof(_resource_map); ++i) {
|
2016-11-18 00:52:42 +01:00
|
|
|
if (!strcmp(resource_map[i].name, resource_name))
|
|
|
|
return resource_map[i].id;
|
|
|
|
}
|
2017-05-17 11:29:28 +02:00
|
|
|
|
2016-11-18 00:52:42 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace client
|