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

Side by Side Diff: ui/base/resource/resource_bundle.h

Issue 1955773002: Enable MD by default on Windows for Canary/Dev and local builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't break first run Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 base::StringPiece* value) = 0; 109 base::StringPiece* value) = 0;
110 110
111 // Retrieve a localized string. Return true if a string was provided or 111 // Retrieve a localized string. Return true if a string was provided or
112 // false to attempt retrieval of the default string. 112 // false to attempt retrieval of the default string.
113 virtual bool GetLocalizedString(int message_id, base::string16* value) = 0; 113 virtual bool GetLocalizedString(int message_id, base::string16* value) = 0;
114 114
115 protected: 115 protected:
116 virtual ~Delegate() {} 116 virtual ~Delegate() {}
117 }; 117 };
118 118
119 // A class which is designed to be instantiated on the stack during early
120 // startup code that needs access to string resources before the
121 // ResourceBundle is loaded.
122 //
123 // This incurs a performance hit, so this should only be used in exceptional
124 // circumstances. Most uses of resources should wait until after the
125 // ResourceBundle has been loaded properly.
126 class UI_BASE_EXPORT TemporaryLoader {
127 public:
128 TemporaryLoader();
129 ~TemporaryLoader();
130
131 private:
132 DISALLOW_COPY_AND_ASSIGN(TemporaryLoader);
133 };
134
119 // Initialize the ResourceBundle for this process. Does not take ownership of 135 // Initialize the ResourceBundle for this process. Does not take ownership of
120 // the |delegate| value. Returns the language selected. 136 // the |delegate| value. Returns the language selected.
121 // NOTE: Mac ignores this and always loads up resources for the language 137 // NOTE: Mac ignores this and always loads up resources for the language
122 // defined by the Cocoa UI (i.e., NSBundle does the language work). 138 // defined by the Cocoa UI (i.e., NSBundle does the language work).
123 // 139 //
124 // TODO(sergeyu): This method also loads common resources (i.e. chrome.pak). 140 // TODO(sergeyu): This method also loads common resources (i.e. chrome.pak).
125 // There is no way to specify which resource files are loaded, i.e. names of 141 // There is no way to specify which resource files are loaded, i.e. names of
126 // the files are hardcoded in ResourceBundle. Fix it to allow to specify which 142 // the files are hardcoded in ResourceBundle. Fix it to allow to specify which
127 // files are loaded (e.g. add a new method in Delegate). 143 // files are loaded (e.g. add a new method in Delegate).
128 // |load_resources| controls whether or not LoadCommonResources is called. 144 // |load_resources| controls whether or not LoadCommonResources is called.
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 459
444 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); 460 DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
445 }; 461 };
446 462
447 } // namespace ui 463 } // namespace ui
448 464
449 // TODO(beng): Someday, maybe, get rid of this. 465 // TODO(beng): Someday, maybe, get rid of this.
450 using ui::ResourceBundle; 466 using ui::ResourceBundle;
451 467
452 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 468 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698