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

Side by Side Diff: chrome/renderer/resource_bundle_source_map.h

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | chrome/renderer/resource_bundle_source_map.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #ifndef CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_
6 #define CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_
7 #pragma once
8
9 #include "base/compiler_specific.h"
10 #include "base/memory/linked_ptr.h"
11 #include "base/string_piece.h"
12 #include "chrome/renderer/module_system.h"
13 #include "chrome/renderer/static_v8_external_string_resource.h"
14 #include "v8/include/v8.h"
15
16 #include <map>
17 #include <string>
18
19 namespace ui {
20 class ResourceBundle;
21 }
22
23 class ResourceBundleSourceMap : public ModuleSystem::SourceMap {
24 public:
25 explicit ResourceBundleSourceMap(const ui::ResourceBundle* resource_bundle);
26 ~ResourceBundleSourceMap();
27
28 virtual v8::Handle<v8::Value> GetSource(const std::string& name) OVERRIDE;
29 virtual bool Contains(const std::string& name) OVERRIDE;
30
31 void RegisterSource(const std::string& name, int resource_id);
32
33 private:
34 v8::Handle<v8::String> ConvertString(const base::StringPiece& string);
35
36 const ui::ResourceBundle* resource_bundle_;
37 std::map<std::string, int> resource_id_map_;
38 };
39
40 #endif // CHROME_RENDERER_RESOURCE_BUNDLE_SOURCE_MAP_H_
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | chrome/renderer/resource_bundle_source_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698