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

Side by Side Diff: chrome/browser/custom_handlers/register_protocol_handler_permission_request.cc

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/custom_handlers/register_protocol_handler_permission_re quest.h" 5 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re quest.h"
6 6
7 #include "base/metrics/user_metrics.h"
7 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
8 #include "build/build_config.h" 9 #include "build/build_config.h"
9 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
10 #include "chrome/grit/generated_resources.h" 11 #include "chrome/grit/generated_resources.h"
11 #include "content/public/browser/user_metrics.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/vector_icons/vector_icons.h" 13 #include "ui/vector_icons/vector_icons.h"
14 14
15 namespace { 15 namespace {
16 16
17 base::string16 GetProtocolName( 17 base::string16 GetProtocolName(
18 const ProtocolHandler& handler) { 18 const ProtocolHandler& handler) {
19 if (handler.protocol() == "mailto") 19 if (handler.protocol() == "mailto")
20 return l10n_util::GetStringUTF16(IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME); 20 return l10n_util::GetStringUTF16(IDS_REGISTER_PROTOCOL_HANDLER_MAILTO_NAME);
21 if (handler.protocol() == "webcal") 21 if (handler.protocol() == "webcal")
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM_REPLACE_FRAGMENT, 54 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM_REPLACE_FRAGMENT,
55 GetProtocolName(handler_), 55 GetProtocolName(handler_),
56 base::UTF8ToUTF16(old_handler.url().host_piece())); 56 base::UTF8ToUTF16(old_handler.url().host_piece()));
57 } 57 }
58 58
59 GURL RegisterProtocolHandlerPermissionRequest::GetOrigin() const { 59 GURL RegisterProtocolHandlerPermissionRequest::GetOrigin() const {
60 return origin_; 60 return origin_;
61 } 61 }
62 62
63 void RegisterProtocolHandlerPermissionRequest::PermissionGranted() { 63 void RegisterProtocolHandlerPermissionRequest::PermissionGranted() {
64 content::RecordAction( 64 base::RecordAction(
65 base::UserMetricsAction("RegisterProtocolHandler.Infobar_Accept")); 65 base::UserMetricsAction("RegisterProtocolHandler.Infobar_Accept"));
66 registry_->OnAcceptRegisterProtocolHandler(handler_); 66 registry_->OnAcceptRegisterProtocolHandler(handler_);
67 } 67 }
68 68
69 void RegisterProtocolHandlerPermissionRequest::PermissionDenied() { 69 void RegisterProtocolHandlerPermissionRequest::PermissionDenied() {
70 content::RecordAction( 70 base::RecordAction(
71 base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny")); 71 base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny"));
72 registry_->OnIgnoreRegisterProtocolHandler(handler_); 72 registry_->OnIgnoreRegisterProtocolHandler(handler_);
73 } 73 }
74 74
75 void RegisterProtocolHandlerPermissionRequest::Cancelled() { 75 void RegisterProtocolHandlerPermissionRequest::Cancelled() {
76 content::RecordAction( 76 base::RecordAction(
77 base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny")); 77 base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny"));
78 registry_->OnIgnoreRegisterProtocolHandler(handler_); 78 registry_->OnIgnoreRegisterProtocolHandler(handler_);
79 } 79 }
80 80
81 void RegisterProtocolHandlerPermissionRequest::RequestFinished() { 81 void RegisterProtocolHandlerPermissionRequest::RequestFinished() {
82 delete this; 82 delete this;
83 } 83 }
84 84
85 PermissionRequestType 85 PermissionRequestType
86 RegisterProtocolHandlerPermissionRequest::GetPermissionRequestType() const { 86 RegisterProtocolHandlerPermissionRequest::GetPermissionRequestType() const {
87 return PermissionRequestType::REGISTER_PROTOCOL_HANDLER; 87 return PermissionRequestType::REGISTER_PROTOCOL_HANDLER;
88 } 88 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/cookie_settings_factory.cc ('k') | chrome/browser/devtools/device/devtools_android_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698