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

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

Issue 8139029: Make policy errors available to display in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unused replacement string DCHECK from policy_error_map.cc Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/resource/resource_bundle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 /* static */ 109 /* static */
110 void ResourceBundle::CleanupSharedInstance() { 110 void ResourceBundle::CleanupSharedInstance() {
111 if (g_shared_instance_) { 111 if (g_shared_instance_) {
112 delete g_shared_instance_; 112 delete g_shared_instance_;
113 g_shared_instance_ = NULL; 113 g_shared_instance_ = NULL;
114 } 114 }
115 } 115 }
116 116
117 /* static */ 117 /* static */
118 bool ResourceBundle::HasSharedInstance() {
119 return g_shared_instance_ != NULL;
120 }
121
122 /* static */
118 ResourceBundle& ResourceBundle::GetSharedInstance() { 123 ResourceBundle& ResourceBundle::GetSharedInstance() {
119 // Must call InitSharedInstance before this function. 124 // Must call InitSharedInstance before this function.
120 CHECK(g_shared_instance_ != NULL); 125 CHECK(g_shared_instance_ != NULL);
121 return *g_shared_instance_; 126 return *g_shared_instance_;
122 } 127 }
123 128
124 /* static */ 129 /* static */
125 bool ResourceBundle::LocaleDataPakExists(const std::string& locale) { 130 bool ResourceBundle::LocaleDataPakExists(const std::string& locale) {
126 return !GetLocaleFilePath(locale).empty(); 131 return !GetLocaleFilePath(locale).empty();
127 } 132 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 415 }
411 416
412 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory( 417 RefCountedStaticMemory* ResourceBundle::LoadedDataPack::GetStaticMemory(
413 int resource_id) const { 418 int resource_id) const {
414 if (!data_pack_.get()) 419 if (!data_pack_.get())
415 return NULL; 420 return NULL;
416 return data_pack_->GetStaticMemory(resource_id); 421 return data_pack_->GetStaticMemory(resource_id);
417 } 422 }
418 423
419 } // namespace ui 424 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698