| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 void EchoPrivateGetUserConsentFunction::OnCancel() { | 201 void EchoPrivateGetUserConsentFunction::OnCancel() { |
| 202 Finalize(false); | 202 Finalize(false); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void EchoPrivateGetUserConsentFunction::OnMoreInfoLinkClicked() { | 205 void EchoPrivateGetUserConsentFunction::OnMoreInfoLinkClicked() { |
| 206 chrome::NavigateParams params( | 206 chrome::NavigateParams params( |
| 207 GetProfile(), GURL(kMoreInfoLink), ui::PAGE_TRANSITION_LINK); | 207 GetProfile(), GURL(kMoreInfoLink), ui::PAGE_TRANSITION_LINK); |
| 208 // Open the link in a new window. The echo dialog is modal, so the current | 208 // Open the link in a new window. The echo dialog is modal, so the current |
| 209 // window is useless until the dialog is closed. | 209 // window is useless until the dialog is closed. |
| 210 params.disposition = NEW_WINDOW; | 210 params.disposition = WindowOpenDisposition::NEW_WINDOW; |
| 211 chrome::Navigate(¶ms); | 211 chrome::Navigate(¶ms); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed() { | 214 void EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed() { |
| 215 chromeos::CrosSettingsProvider::TrustedStatus status = | 215 chromeos::CrosSettingsProvider::TrustedStatus status = |
| 216 chromeos::CrosSettings::Get()->PrepareTrustedValues(base::Bind( | 216 chromeos::CrosSettings::Get()->PrepareTrustedValues(base::Bind( |
| 217 &EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed, | 217 &EchoPrivateGetUserConsentFunction::CheckRedeemOffersAllowed, |
| 218 this)); | 218 this)); |
| 219 if (status == chromeos::CrosSettingsProvider::TEMPORARILY_UNTRUSTED) | 219 if (status == chromeos::CrosSettingsProvider::TEMPORARILY_UNTRUSTED) |
| 220 return; | 220 return; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) { | 271 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) { |
| 272 // Consent should not be true if offers redeeming is disabled. | 272 // Consent should not be true if offers redeeming is disabled. |
| 273 CHECK(redeem_offers_allowed_ || !consent); | 273 CHECK(redeem_offers_allowed_ || !consent); |
| 274 results_ = echo_api::GetUserConsent::Results::Create(consent); | 274 results_ = echo_api::GetUserConsent::Results::Create(consent); |
| 275 SendResponse(true); | 275 SendResponse(true); |
| 276 | 276 |
| 277 // Release the reference added in |OnRedeemOffersAllowedChecked|, before | 277 // Release the reference added in |OnRedeemOffersAllowedChecked|, before |
| 278 // showing the dialog. | 278 // showing the dialog. |
| 279 Release(); | 279 Release(); |
| 280 } | 280 } |
| OLD | NEW |