Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/FilterEngine.cpp

Issue 11339006: GetAppLocale and GetDocumentationLink for IE faking (Closed)
Patch Set: Created Aug. 1, 2013, 7:36 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/AdblockPlus/FilterEngine.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 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 func->Call(params); 270 func->Call(params);
271 } 271 }
272 272
273 void FilterEngine::UpdateCheckDone(const std::string& eventName, FilterEngine::U pdaterCallback callback, JsValueList& params) 273 void FilterEngine::UpdateCheckDone(const std::string& eventName, FilterEngine::U pdaterCallback callback, JsValueList& params)
274 { 274 {
275 jsEngine->RemoveEventCallback(eventName); 275 jsEngine->RemoveEventCallback(eventName);
276 276
277 std::string error(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsSt ring() : ""); 277 std::string error(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsSt ring() : "");
278 callback(error); 278 callback(error);
279 } 279 }
280
281 std::string FilterEngine::GetAppLocale()
282 {
283 JsValuePtr locale = jsEngine->Evaluate("require(\"utils\").Utils.appLocale");
284 return locale->AsString();
Wladimir Palant 2013/08/01 11:49:09 The app locale is being passed in by the host appl
285 }
286
287 std::string FilterEngine::GetDocumentationLink()
288 {
289 JsValuePtr docLink = jsEngine->Evaluate("require(\"prefs\").Prefs.documentatio n_link");
290 return docLink->AsString();
Wladimir Palant 2013/08/01 11:49:09 There is already an API to get preferences, why no
291 }
OLDNEW
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld