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

Side by Side Diff: extensions/browser/extension_function.cc

Issue 227413008: Add the feature to retain the user gesture in the extension callback (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/extension_function.h" 5 #include "extensions/browser/extension_function.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "content/public/browser/notification_source.h" 9 #include "content/public/browser/notification_source.h"
10 #include "content/public/browser/notification_types.h" 10 #include "content/public/browser/notification_types.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); 69 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker);
70 }; 70 };
71 71
72 ExtensionFunction::ExtensionFunction() 72 ExtensionFunction::ExtensionFunction()
73 : request_id_(-1), 73 : request_id_(-1),
74 profile_id_(NULL), 74 profile_id_(NULL),
75 has_callback_(false), 75 has_callback_(false),
76 include_incognito_(false), 76 include_incognito_(false),
77 user_gesture_(false), 77 user_gesture_(false),
78 retain_user_gesture_(false),
78 bad_message_(false), 79 bad_message_(false),
79 histogram_value_(extensions::functions::UNKNOWN), 80 histogram_value_(extensions::functions::UNKNOWN),
80 source_tab_id_(-1) { 81 source_tab_id_(-1) {
81 } 82 }
82 83
83 ExtensionFunction::~ExtensionFunction() { 84 ExtensionFunction::~ExtensionFunction() {
84 } 85 }
85 86
86 UIThreadExtensionFunction* ExtensionFunction::AsUIThreadExtensionFunction() { 87 UIThreadExtensionFunction* ExtensionFunction::AsUIThreadExtensionFunction() {
87 return NULL; 88 return NULL;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 ResponseType type = success ? SUCCEEDED : FAILED; 148 ResponseType type = success ? SUCCEEDED : FAILED;
148 if (bad_message_) { 149 if (bad_message_) {
149 type = BAD_MESSAGE; 150 type = BAD_MESSAGE;
150 LOG(ERROR) << "Bad extension message " << name_; 151 LOG(ERROR) << "Bad extension message " << name_;
151 } 152 }
152 153
153 // If results were never set, we send an empty argument list. 154 // If results were never set, we send an empty argument list.
154 if (!results_) 155 if (!results_)
155 results_.reset(new base::ListValue()); 156 results_.reset(new base::ListValue());
156 157
157 response_callback_.Run(type, *results_, GetError()); 158 response_callback_.Run(type, *results_, GetError(), retain_user_gesture_);
not at google - send to devlin 2014/04/09 16:44:32 it should be "user_gesture_ && retain_user_gesture
158 } 159 }
159 160
160 UIThreadExtensionFunction::UIThreadExtensionFunction() 161 UIThreadExtensionFunction::UIThreadExtensionFunction()
161 : render_view_host_(NULL), 162 : render_view_host_(NULL),
162 render_frame_host_(NULL), 163 render_frame_host_(NULL),
163 context_(NULL), 164 context_(NULL),
164 delegate_(NULL) { 165 delegate_(NULL) {
165 } 166 }
166 167
167 UIThreadExtensionFunction::~UIThreadExtensionFunction() { 168 UIThreadExtensionFunction::~UIThreadExtensionFunction() {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 262
262 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 263 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
263 } 264 }
264 265
265 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 266 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
266 } 267 }
267 268
268 void SyncIOThreadExtensionFunction::Run() { 269 void SyncIOThreadExtensionFunction::Run() {
269 SendResponse(RunImpl()); 270 SendResponse(RunImpl());
270 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698