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

Unified Diff: chrome/browser/extensions/api/app/app_api.cc

Issue 9737001: Fix crash in AppNotifyChannelSetup when incognito profiles are used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgot a file Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/app/app_api.cc
diff --git a/chrome/browser/extensions/api/app/app_api.cc b/chrome/browser/extensions/api/app/app_api.cc
index a03c603df119403b9dc9a9abf7b45a34d890326d..663b59bfd066ab55dc7311f1c70244dd98803714 100644
--- a/chrome/browser/extensions/api/app/app_api.cc
+++ b/chrome/browser/extensions/api/app/app_api.cc
@@ -23,8 +23,16 @@ const char kInvalidExtensionIdError[] =
"Invalid extension id";
const char kMissingLinkTextError[] =
"You must specify linkText if you use linkUrl";
+const char kIncognitoError[] =
+ "This API is not accessible by 'split' mode "
+ "extensions in incognito windows.";
bool AppNotifyFunction::RunImpl() {
+ if (!include_incognito() && profile_->IsOffTheRecord()) {
Mihai Parparita -not on Chrome 2012/03/22 19:44:20 There are actually two app notification APIs: 1) T
jstritar 2012/03/22 20:21:10 Oh yeah, done. Do you know why this needs such cus
asargent_no_longer_on_chrome 2012/03/22 20:58:11 Because it's exposed to hosted apps, which the reg
jstritar 2012/03/23 15:31:43 Thanks for the explanation! We might be able to ge
+ error_ = kIncognitoError;
+ return false;
+ }
+
DictionaryValue* details;
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details));
EXTENSION_FUNCTION_VALIDATE(details != NULL);
@@ -77,6 +85,11 @@ bool AppNotifyFunction::RunImpl() {
}
bool AppClearAllNotificationsFunction::RunImpl() {
+ if (!include_incognito() && profile_->IsOffTheRecord()) {
+ error_ = kIncognitoError;
+ return false;
+ }
+
std::string id = extension_id();
DictionaryValue* details = NULL;
if (args_->GetDictionary(0, &details) && details->HasKey(kExtensionIdKey)) {

Powered by Google App Engine
This is Rietveld 408576698