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

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

Issue 454253002: Location chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Swapping to address InfoBar currying callback case Created 6 years, 4 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/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
9 #include "content/public/browser/user_metrics.h" 9 #include "content/public/browser/user_metrics.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 20 matching lines...) Expand all
31 GURL url, 31 GURL url,
32 bool user_gesture) 32 bool user_gesture)
33 : registry_(registry), 33 : registry_(registry),
34 handler_(handler), 34 handler_(handler),
35 url_(url), 35 url_(url),
36 user_gesture_(user_gesture) {} 36 user_gesture_(user_gesture) {}
37 37
38 RegisterProtocolHandlerPermissionRequest:: 38 RegisterProtocolHandlerPermissionRequest::
39 ~RegisterProtocolHandlerPermissionRequest() {} 39 ~RegisterProtocolHandlerPermissionRequest() {}
40 40
41 PermissionBubbleRequest::Type
42 RegisterProtocolHandlerPermissionRequest::GetType() const {
43 return PermissionBubbleRequest::Type::kOther;
44 }
45
41 int RegisterProtocolHandlerPermissionRequest::GetIconID() const { 46 int RegisterProtocolHandlerPermissionRequest::GetIconID() const {
42 return IDR_REGISTER_PROTOCOL_HANDLER; 47 return IDR_REGISTER_PROTOCOL_HANDLER;
43 } 48 }
44 49
45 base::string16 50 base::string16
46 RegisterProtocolHandlerPermissionRequest::GetMessageText() const { 51 RegisterProtocolHandlerPermissionRequest::GetMessageText() const {
47 ProtocolHandler old_handler = registry_->GetHandlerFor(handler_.protocol()); 52 ProtocolHandler old_handler = registry_->GetHandlerFor(handler_.protocol());
48 return old_handler.IsEmpty() ? 53 return old_handler.IsEmpty() ?
49 l10n_util::GetStringFUTF16( 54 l10n_util::GetStringFUTF16(
50 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM, 55 IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 97
93 void RegisterProtocolHandlerPermissionRequest::Cancelled() { 98 void RegisterProtocolHandlerPermissionRequest::Cancelled() {
94 content::RecordAction( 99 content::RecordAction(
95 base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny")); 100 base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Deny"));
96 registry_->OnIgnoreRegisterProtocolHandler(handler_); 101 registry_->OnIgnoreRegisterProtocolHandler(handler_);
97 } 102 }
98 103
99 void RegisterProtocolHandlerPermissionRequest::RequestFinished() { 104 void RegisterProtocolHandlerPermissionRequest::RequestFinished() {
100 delete this; 105 delete this;
101 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698