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

Side by Side Diff: webkit/plugins/npapi/webplugin_delegate_impl_win.cc

Issue 13219005: Replace string16 with base::string16 in src/webkit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
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 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 int major_version = 0; 197 int major_version = 0;
198 if (plugin_version.IsValid()) 198 if (plugin_version.IsValid())
199 major_version = plugin_version.components()[0]; 199 major_version = plugin_version.components()[0];
200 200
201 return major_version; 201 return major_version;
202 } 202 }
203 203
204 bool GetPluginPropertyFromWindow( 204 bool GetPluginPropertyFromWindow(
205 HWND window, const wchar_t* plugin_atom_property, 205 HWND window, const wchar_t* plugin_atom_property,
206 string16* plugin_property) { 206 base::string16* plugin_property) {
207 ATOM plugin_atom = reinterpret_cast<ATOM>( 207 ATOM plugin_atom = reinterpret_cast<ATOM>(
208 GetPropW(window, plugin_atom_property)); 208 GetPropW(window, plugin_atom_property));
209 if (plugin_atom != 0) { 209 if (plugin_atom != 0) {
210 WCHAR plugin_property_local[MAX_PATH] = {0}; 210 WCHAR plugin_property_local[MAX_PATH] = {0};
211 GlobalGetAtomNameW(plugin_atom, 211 GlobalGetAtomNameW(plugin_atom,
212 plugin_property_local, 212 plugin_property_local,
213 ARRAYSIZE(plugin_property_local)); 213 ARRAYSIZE(plugin_property_local));
214 *plugin_property = plugin_property_local; 214 *plugin_property = plugin_property_local;
215 return true; 215 return true;
216 } 216 }
217 return false; 217 return false;
218 } 218 }
219 219
220 } // namespace 220 } // namespace
221 221
222 bool WebPluginDelegateImpl::IsPluginDelegateWindow(HWND window) { 222 bool WebPluginDelegateImpl::IsPluginDelegateWindow(HWND window) {
223 return ui::GetClassName(window) == string16(kNativeWindowClassName); 223 return ui::GetClassName(window) == base::string16(kNativeWindowClassName);
224 } 224 }
225 225
226 // static 226 // static
227 bool WebPluginDelegateImpl::GetPluginNameFromWindow( 227 bool WebPluginDelegateImpl::GetPluginNameFromWindow(
228 HWND window, string16* plugin_name) { 228 HWND window, base::string16* plugin_name) {
229 return IsPluginDelegateWindow(window) && 229 return IsPluginDelegateWindow(window) &&
230 GetPluginPropertyFromWindow( 230 GetPluginPropertyFromWindow(
231 window, kPluginNameAtomProperty, plugin_name); 231 window, kPluginNameAtomProperty, plugin_name);
232 } 232 }
233 233
234 // static 234 // static
235 bool WebPluginDelegateImpl::GetPluginVersionFromWindow( 235 bool WebPluginDelegateImpl::GetPluginVersionFromWindow(
236 HWND window, string16* plugin_version) { 236 HWND window, base::string16* plugin_version) {
237 return IsPluginDelegateWindow(window) && 237 return IsPluginDelegateWindow(window) &&
238 GetPluginPropertyFromWindow( 238 GetPluginPropertyFromWindow(
239 window, kPluginVersionAtomProperty, plugin_version); 239 window, kPluginVersionAtomProperty, plugin_version);
240 } 240 }
241 241
242 bool WebPluginDelegateImpl::IsDummyActivationWindow(HWND window) { 242 bool WebPluginDelegateImpl::IsDummyActivationWindow(HWND window) {
243 if (!IsWindow(window)) 243 if (!IsWindow(window))
244 return false; 244 return false;
245 245
246 wchar_t window_title[MAX_PATH + 1] = {0}; 246 wchar_t window_title[MAX_PATH + 1] = {0};
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 std::wstring plugin_name = plugin_lib->plugin_info().name; 553 std::wstring plugin_name = plugin_lib->plugin_info().name;
554 if (!plugin_name.empty()) { 554 if (!plugin_name.empty()) {
555 ATOM plugin_name_atom = GlobalAddAtomW(plugin_name.c_str()); 555 ATOM plugin_name_atom = GlobalAddAtomW(plugin_name.c_str());
556 DCHECK_NE(0, plugin_name_atom); 556 DCHECK_NE(0, plugin_name_atom);
557 result = SetProp(windowed_handle_, 557 result = SetProp(windowed_handle_,
558 kPluginNameAtomProperty, 558 kPluginNameAtomProperty,
559 reinterpret_cast<HANDLE>(plugin_name_atom)); 559 reinterpret_cast<HANDLE>(plugin_name_atom));
560 DCHECK(result == TRUE) << "SetProp failed, last error = " << 560 DCHECK(result == TRUE) << "SetProp failed, last error = " <<
561 GetLastError(); 561 GetLastError();
562 } 562 }
563 string16 plugin_version = plugin_lib->plugin_info().version; 563 base::string16 plugin_version = plugin_lib->plugin_info().version;
564 if (!plugin_version.empty()) { 564 if (!plugin_version.empty()) {
565 ATOM plugin_version_atom = GlobalAddAtomW(plugin_version.c_str()); 565 ATOM plugin_version_atom = GlobalAddAtomW(plugin_version.c_str());
566 DCHECK_NE(0, plugin_version_atom); 566 DCHECK_NE(0, plugin_version_atom);
567 result = SetProp(windowed_handle_, 567 result = SetProp(windowed_handle_,
568 kPluginVersionAtomProperty, 568 kPluginVersionAtomProperty,
569 reinterpret_cast<HANDLE>(plugin_version_atom)); 569 reinterpret_cast<HANDLE>(plugin_version_atom));
570 DCHECK(result == TRUE) << "SetProp failed, last error = " << 570 DCHECK(result == TRUE) << "SetProp failed, last error = " <<
571 GetLastError(); 571 GetLastError();
572 } 572 }
573 } 573 }
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 static const wchar_t kChromeExeName[] = L"chrome.exe"; 1470 static const wchar_t kChromeExeName[] = L"chrome.exe";
1471 wcsncpy_s(name, orig_size, kChromeExeName, arraysize(kChromeExeName)); 1471 wcsncpy_s(name, orig_size, kChromeExeName, arraysize(kChromeExeName));
1472 *name_size = 1472 *name_size =
1473 std::min(orig_size, static_cast<DWORD>(arraysize(kChromeExeName))); 1473 std::min(orig_size, static_cast<DWORD>(arraysize(kChromeExeName)));
1474 } 1474 }
1475 1475
1476 return rv; 1476 return rv;
1477 } 1477 }
1478 1478
1479 void WebPluginDelegateImpl::ImeCompositionUpdated( 1479 void WebPluginDelegateImpl::ImeCompositionUpdated(
1480 const string16& text, 1480 const base::string16& text,
1481 const std::vector<int>& clauses, 1481 const std::vector<int>& clauses,
1482 const std::vector<int>& target, 1482 const std::vector<int>& target,
1483 int cursor_position) { 1483 int cursor_position) {
1484 if (!plugin_ime_.get()) 1484 if (!plugin_ime_.get())
1485 plugin_ime_.reset(new WebPluginIMEWin); 1485 plugin_ime_.reset(new WebPluginIMEWin);
1486 1486
1487 plugin_ime_->CompositionUpdated(text, clauses, target, cursor_position); 1487 plugin_ime_->CompositionUpdated(text, clauses, target, cursor_position);
1488 plugin_ime_->SendEvents(instance()); 1488 plugin_ime_->SendEvents(instance());
1489 } 1489 }
1490 1490
1491 void WebPluginDelegateImpl::ImeCompositionCompleted(const string16& text) { 1491 void WebPluginDelegateImpl::ImeCompositionCompleted(
1492 const base::string16& text) {
1492 if (!plugin_ime_.get()) 1493 if (!plugin_ime_.get())
1493 plugin_ime_.reset(new WebPluginIMEWin); 1494 plugin_ime_.reset(new WebPluginIMEWin);
1494 plugin_ime_->CompositionCompleted(text); 1495 plugin_ime_->CompositionCompleted(text);
1495 plugin_ime_->SendEvents(instance()); 1496 plugin_ime_->SendEvents(instance());
1496 } 1497 }
1497 1498
1498 bool WebPluginDelegateImpl::GetIMEStatus(int* input_type, 1499 bool WebPluginDelegateImpl::GetIMEStatus(int* input_type,
1499 gfx::Rect* caret_rect) { 1500 gfx::Rect* caret_rect) {
1500 if (!plugin_ime_.get()) 1501 if (!plugin_ime_.get())
1501 return false; 1502 return false;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 ::ReleaseCapture(); 1536 ::ReleaseCapture();
1536 break; 1537 break;
1537 1538
1538 default: 1539 default:
1539 break; 1540 break;
1540 } 1541 }
1541 } 1542 }
1542 1543
1543 } // namespace npapi 1544 } // namespace npapi
1544 } // namespace webkit 1545 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698