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

Side by Side Diff: chrome_frame/np_utils.cc

Issue 7276037: Remove NPAPI support from Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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_frame/np_utils.h ('k') | chrome_frame/npapi_url_request.h » ('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) 2011 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 #define NO_NSPR_10_SUPPORT
6 #include "chrome_frame/np_utils.h"
7
8 #include "chrome_frame/np_browser_functions.h"
9
10 namespace np_utils {
11
12 std::string GetLocation(NPP instance, NPObject* window) {
13 if (!window) {
14 // Can fail if the browser is closing (seen in Opera).
15 return "";
16 }
17
18 std::string result;
19 ScopedNpVariant href;
20 ScopedNpVariant location;
21
22 bool ok = npapi::GetProperty(instance,
23 window,
24 npapi::GetStringIdentifier("location"),
25 &location);
26 DCHECK(ok);
27 DCHECK(location.type == NPVariantType_Object);
28
29 if (ok) {
30 ok = npapi::GetProperty(instance,
31 location.value.objectValue,
32 npapi::GetStringIdentifier("href"),
33 &href);
34 DCHECK(ok);
35 DCHECK(href.type == NPVariantType_String);
36 if (ok) {
37 result.assign(href.value.stringValue.UTF8Characters,
38 href.value.stringValue.UTF8Length);
39 }
40 }
41
42 return result;
43 }
44
45 } // namespace np_utils
OLDNEW
« no previous file with comments | « chrome_frame/np_utils.h ('k') | chrome_frame/npapi_url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698