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

Side by Side Diff: chrome/browser/extensions/api/passwords_private/passwords_private_api.cc

Issue 2845543002: Show human readable origin for Android apps (Closed)
Patch Set: Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/passwords_private/passwords_private_api. h" 5 #include "chrome/browser/extensions/api/passwords_private/passwords_private_api. h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 15 matching lines...) Expand all
26 ExtensionFunction::ResponseAction 26 ExtensionFunction::ResponseAction
27 PasswordsPrivateRemoveSavedPasswordFunction::Run() { 27 PasswordsPrivateRemoveSavedPasswordFunction::Run() {
28 std::unique_ptr<api::passwords_private::RemoveSavedPassword::Params> 28 std::unique_ptr<api::passwords_private::RemoveSavedPassword::Params>
29 parameters = 29 parameters =
30 api::passwords_private::RemoveSavedPassword::Params::Create(*args_); 30 api::passwords_private::RemoveSavedPassword::Params::Create(*args_);
31 EXTENSION_FUNCTION_VALIDATE(parameters.get()); 31 EXTENSION_FUNCTION_VALIDATE(parameters.get());
32 32
33 PasswordsPrivateDelegate* delegate = 33 PasswordsPrivateDelegate* delegate =
34 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), 34 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(),
35 true /* create */); 35 true /* create */);
36 delegate->RemoveSavedPassword( 36 delegate->RemoveSavedPassword(parameters->login_pair.urls.origin,
37 parameters->login_pair.origin_url, 37 parameters->login_pair.username);
38 parameters->login_pair.username);
39 38
40 return RespondNow(NoArguments()); 39 return RespondNow(NoArguments());
41 } 40 }
42 41
43 //////////////////////////////////////////////////////////////////////////////// 42 ////////////////////////////////////////////////////////////////////////////////
44 // PasswordsPrivateRemovePasswordExceptionFunction 43 // PasswordsPrivateRemovePasswordExceptionFunction
45 44
46 PasswordsPrivateRemovePasswordExceptionFunction:: 45 PasswordsPrivateRemovePasswordExceptionFunction::
47 ~PasswordsPrivateRemovePasswordExceptionFunction() {} 46 ~PasswordsPrivateRemovePasswordExceptionFunction() {}
48 47
(...skipping 24 matching lines...) Expand all
73 std::unique_ptr<api::passwords_private::RequestPlaintextPassword::Params> 72 std::unique_ptr<api::passwords_private::RequestPlaintextPassword::Params>
74 parameters = 73 parameters =
75 api::passwords_private::RequestPlaintextPassword::Params::Create( 74 api::passwords_private::RequestPlaintextPassword::Params::Create(
76 *args_); 75 *args_);
77 EXTENSION_FUNCTION_VALIDATE(parameters.get()); 76 EXTENSION_FUNCTION_VALIDATE(parameters.get());
78 77
79 PasswordsPrivateDelegate* delegate = 78 PasswordsPrivateDelegate* delegate =
80 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), 79 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(),
81 true /* create */); 80 true /* create */);
82 81
83 delegate->RequestShowPassword(parameters->login_pair.origin_url, 82 delegate->RequestShowPassword(parameters->login_pair.urls.origin,
84 parameters->login_pair.username, 83 parameters->login_pair.username,
85 GetSenderWebContents()); 84 GetSenderWebContents());
86 85
87 // No response given from this API function; instead, listeners wait for the 86 // No response given from this API function; instead, listeners wait for the
88 // chrome.passwordsPrivate.onPlaintextPasswordRetrieved event to fire. 87 // chrome.passwordsPrivate.onPlaintextPasswordRetrieved event to fire.
89 return RespondNow(NoArguments()); 88 return RespondNow(NoArguments());
90 } 89 }
91 90
92 //////////////////////////////////////////////////////////////////////////////// 91 ////////////////////////////////////////////////////////////////////////////////
93 // PasswordsPrivateGetSavedPasswordListFunction 92 // PasswordsPrivateGetSavedPasswordListFunction
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 137
139 void PasswordsPrivateGetPasswordExceptionListFunction::GetList() { 138 void PasswordsPrivateGetPasswordExceptionListFunction::GetList() {
140 PasswordsPrivateDelegate* delegate = 139 PasswordsPrivateDelegate* delegate =
141 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(), 140 PasswordsPrivateDelegateFactory::GetForBrowserContext(browser_context(),
142 true /* create */); 141 true /* create */);
143 delegate->GetPasswordExceptionsList(base::Bind( 142 delegate->GetPasswordExceptionsList(base::Bind(
144 &PasswordsPrivateGetPasswordExceptionListFunction::GotList, this)); 143 &PasswordsPrivateGetPasswordExceptionListFunction::GotList, this));
145 } 144 }
146 145
147 void PasswordsPrivateGetPasswordExceptionListFunction::GotList( 146 void PasswordsPrivateGetPasswordExceptionListFunction::GotList(
148 const PasswordsPrivateDelegate::ExceptionPairs& list) { 147 const PasswordsPrivateDelegate::ExceptionEntries& entries) {
149 Respond(ArgumentList( 148 Respond(ArgumentList(
150 api::passwords_private::GetPasswordExceptionList::Results::Create(list))); 149 api::passwords_private::GetPasswordExceptionList::Results::Create(
150 entries)));
151 } 151 }
152 152
153 } // namespace extensions 153 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698