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

Side by Side Diff: app/resource_bundle_win.cc

Issue 193072: Move StringPiece into the base namespace. It is colliding (Closed)
Patch Set: take 2 Created 11 years, 3 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
« no previous file with comments | « app/resource_bundle_mac.mm ('k') | base/data_pack.h » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "app/resource_bundle.h" 5 #include "app/resource_bundle.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 8
9 #include "app/app_paths.h" 9 #include "app/app_paths.h"
10 #include "app/gfx/font.h" 10 #include "app/gfx/font.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return true; 98 return true;
99 } else { 99 } else {
100 return false; 100 return false;
101 } 101 }
102 } 102 }
103 103
104 HICON ResourceBundle::LoadThemeIcon(int icon_id) { 104 HICON ResourceBundle::LoadThemeIcon(int icon_id) {
105 return ::LoadIcon(theme_data_, MAKEINTRESOURCE(icon_id)); 105 return ::LoadIcon(theme_data_, MAKEINTRESOURCE(icon_id));
106 } 106 }
107 107
108 StringPiece ResourceBundle::GetRawDataResource(int resource_id) { 108 base::StringPiece ResourceBundle::GetRawDataResource(int resource_id) {
109 void* data_ptr; 109 void* data_ptr;
110 size_t data_size; 110 size_t data_size;
111 if (base::GetDataResourceFromModule(_AtlBaseModule.GetModuleInstance(), 111 if (base::GetDataResourceFromModule(_AtlBaseModule.GetModuleInstance(),
112 resource_id, 112 resource_id,
113 &data_ptr, 113 &data_ptr,
114 &data_size)) { 114 &data_size)) {
115 return StringPiece(static_cast<const char*>(data_ptr), data_size); 115 return base::StringPiece(static_cast<const char*>(data_ptr), data_size);
116 } else if (locale_resources_data_ && 116 } else if (locale_resources_data_ &&
117 base::GetDataResourceFromModule(locale_resources_data_, 117 base::GetDataResourceFromModule(locale_resources_data_,
118 resource_id, 118 resource_id,
119 &data_ptr, 119 &data_ptr,
120 &data_size)) { 120 &data_size)) {
121 return StringPiece(static_cast<const char*>(data_ptr), data_size); 121 return base::StringPiece(static_cast<const char*>(data_ptr), data_size);
122 } 122 }
123 return StringPiece(); 123 return base::StringPiece();
124 } 124 }
125 125
126 // Loads and returns a cursor from the current module. 126 // Loads and returns a cursor from the current module.
127 HCURSOR ResourceBundle::LoadCursor(int cursor_id) { 127 HCURSOR ResourceBundle::LoadCursor(int cursor_id) {
128 return ::LoadCursor(_AtlBaseModule.GetModuleInstance(), 128 return ::LoadCursor(_AtlBaseModule.GetModuleInstance(),
129 MAKEINTRESOURCE(cursor_id)); 129 MAKEINTRESOURCE(cursor_id));
130 } 130 }
131 131
132 string16 ResourceBundle::GetLocalizedString(int message_id) { 132 string16 ResourceBundle::GetLocalizedString(int message_id) {
133 // If for some reason we were unable to load a resource dll, return an empty 133 // If for some reason we were unable to load a resource dll, return an empty
(...skipping 15 matching lines...) Expand all
149 image = AtlGetStringResourceImage(_AtlBaseModule.GetModuleInstance(), 149 image = AtlGetStringResourceImage(_AtlBaseModule.GetModuleInstance(),
150 message_id); 150 message_id);
151 if (!image) { 151 if (!image) {
152 NOTREACHED() << "unable to find resource: " << message_id; 152 NOTREACHED() << "unable to find resource: " << message_id;
153 return std::wstring(); 153 return std::wstring();
154 } 154 }
155 } 155 }
156 // Copy into a string16 and return. 156 // Copy into a string16 and return.
157 return string16(image->achString, image->nLength); 157 return string16(image->achString, image->nLength);
158 } 158 }
OLDNEW
« no previous file with comments | « app/resource_bundle_mac.mm ('k') | base/data_pack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698