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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 69913002: Add UMA for <webview> APIs: a. ClearData, b. when Permission request is allowed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shorten UMA string literals Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/guestview/webview/webview_guest.cc ('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 // 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 "content/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 429 }
430 430
431 int request_id = ++next_permission_request_id_; 431 int request_id = ++next_permission_request_id_;
432 permission_request_map_[request_id] = request; 432 permission_request_map_[request_id] = request;
433 433
434 BrowserPluginGuestDelegate::PermissionResponseCallback callback = 434 BrowserPluginGuestDelegate::PermissionResponseCallback callback =
435 base::Bind(&BrowserPluginGuest::RespondToPermissionRequest, 435 base::Bind(&BrowserPluginGuest::RespondToPermissionRequest,
436 AsWeakPtr(), 436 AsWeakPtr(),
437 request_id); 437 request_id);
438 // If BrowserPluginGuestDelegate hasn't handled the permission then we simply 438 // If BrowserPluginGuestDelegate hasn't handled the permission then we simply
439 // reject it immediately. 439 // perform the default action (which is one of allow or reject) immediately.
440 if (!delegate_->RequestPermission( 440 if (!delegate_->RequestPermission(
441 permission_type, request_info, callback, request->AllowedByDefault())) { 441 permission_type, request_info, callback, request->AllowedByDefault())) {
442 callback.Run(request->AllowedByDefault(), ""); 442 callback.Run(request->AllowedByDefault(), "");
443 return browser_plugin::kInvalidPermissionRequestID; 443 return browser_plugin::kInvalidPermissionRequestID;
444 } 444 }
445 445
446 return request_id; 446 return request_id;
447 } 447 }
448 448
449 BrowserPluginGuest* BrowserPluginGuest::CreateNewGuestWindow( 449 BrowserPluginGuest* BrowserPluginGuest::CreateNewGuestWindow(
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 request_info.Set(browser_plugin::kRequestMethod, 1731 request_info.Set(browser_plugin::kRequestMethod,
1732 base::Value::CreateStringValue(request_method)); 1732 base::Value::CreateStringValue(request_method));
1733 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); 1733 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url));
1734 1734
1735 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, 1735 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD,
1736 new DownloadRequest(callback), 1736 new DownloadRequest(callback),
1737 request_info); 1737 request_info);
1738 } 1738 }
1739 1739
1740 } // namespace content 1740 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/guestview/webview/webview_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698