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

Side by Side Diff: chrome/renderer/extensions/dispatcher.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 (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 "chrome/renderer/extensions/dispatcher.h" 5 #include "chrome/renderer/extensions/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1594
1595 if (url.is_valid()) 1595 if (url.is_valid())
1596 return Feature::WEB_PAGE_CONTEXT; 1596 return Feature::WEB_PAGE_CONTEXT;
1597 1597
1598 return Feature::UNSPECIFIED_CONTEXT; 1598 return Feature::UNSPECIFIED_CONTEXT;
1599 } 1599 }
1600 1600
1601 void Dispatcher::OnExtensionResponse(int request_id, 1601 void Dispatcher::OnExtensionResponse(int request_id,
1602 bool success, 1602 bool success,
1603 const base::ListValue& response, 1603 const base::ListValue& response,
1604 const std::string& error) { 1604 const std::string& error,
1605 request_sender_->HandleResponse(request_id, success, response, error); 1605 bool user_gesture) {
1606 request_sender_->HandleResponse(request_id, success, response, error,
1607 user_gesture);
1606 } 1608 }
1607 1609
1608 bool Dispatcher::CheckContextAccessToExtensionAPI( 1610 bool Dispatcher::CheckContextAccessToExtensionAPI(
1609 const std::string& function_name, ChromeV8Context* context) const { 1611 const std::string& function_name, ChromeV8Context* context) const {
1610 if (!context) { 1612 if (!context) {
1611 DLOG(ERROR) << "Not in a v8::Context"; 1613 DLOG(ERROR) << "Not in a v8::Context";
1612 return false; 1614 return false;
1613 } 1615 }
1614 1616
1615 if (!context->extension()) { 1617 if (!context->extension()) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 } 1698 }
1697 1699
1698 void Dispatcher::ClearPortData(int port_id) { 1700 void Dispatcher::ClearPortData(int port_id) {
1699 // Only the target port side has entries in |port_to_tab_id_map_|. If 1701 // Only the target port side has entries in |port_to_tab_id_map_|. If
1700 // |port_id| is a source port, std::map::erase() will just silently fail 1702 // |port_id| is a source port, std::map::erase() will just silently fail
1701 // here as a no-op. 1703 // here as a no-op.
1702 port_to_tab_id_map_.erase(port_id); 1704 port_to_tab_id_map_.erase(port_id);
1703 } 1705 }
1704 1706
1705 } // namespace extensions 1707 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698