OLD | NEW |
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/browser/chromeos/extensions/echo_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/echo_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void EchoPrivateGetUserConsentFunction::OnAccept() { | 207 void EchoPrivateGetUserConsentFunction::OnAccept() { |
208 Finalize(true); | 208 Finalize(true); |
209 } | 209 } |
210 | 210 |
211 void EchoPrivateGetUserConsentFunction::OnCancel() { | 211 void EchoPrivateGetUserConsentFunction::OnCancel() { |
212 Finalize(false); | 212 Finalize(false); |
213 } | 213 } |
214 | 214 |
215 void EchoPrivateGetUserConsentFunction::OnMoreInfoLinkClicked() { | 215 void EchoPrivateGetUserConsentFunction::OnMoreInfoLinkClicked() { |
216 chrome::NavigateParams params( | 216 chrome::NavigateParams params( |
217 GetProfile(), GURL(kMoreInfoLink), content::PAGE_TRANSITION_LINK); | 217 GetProfile(), GURL(kMoreInfoLink), ui::PAGE_TRANSITION_LINK); |
218 // Open the link in a new window. The echo dialog is modal, so the current | 218 // Open the link in a new window. The echo dialog is modal, so the current |
219 // window is useless until the dialog is closed. | 219 // window is useless until the dialog is closed. |
220 params.disposition = NEW_WINDOW; | 220 params.disposition = NEW_WINDOW; |
221 chrome::Navigate(¶ms); | 221 chrome::Navigate(¶ms); |
222 } | 222 } |
223 | 223 |
224 void EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed() { | 224 void EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed() { |
225 chromeos::CrosSettingsProvider::TrustedStatus status = | 225 chromeos::CrosSettingsProvider::TrustedStatus status = |
226 chromeos::CrosSettings::Get()->PrepareTrustedValues(base::Bind( | 226 chromeos::CrosSettings::Get()->PrepareTrustedValues(base::Bind( |
227 &EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed, | 227 &EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) { | 274 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) { |
275 // Consent should not be true if offers redeeming is disabled. | 275 // Consent should not be true if offers redeeming is disabled. |
276 CHECK(redeem_offers_allowed_ || !consent); | 276 CHECK(redeem_offers_allowed_ || !consent); |
277 results_ = echo_api::GetUserConsent::Results::Create(consent); | 277 results_ = echo_api::GetUserConsent::Results::Create(consent); |
278 SendResponse(true); | 278 SendResponse(true); |
279 | 279 |
280 // Release the reference added in |OnRedeemOffersAllowedChecked|, before | 280 // Release the reference added in |OnRedeemOffersAllowedChecked|, before |
281 // showing the dialog. | 281 // showing the dialog. |
282 Release(); | 282 Release(); |
283 } | 283 } |
OLD | NEW |