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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_screen_handler.cc

Issue 10413072: Teaching BrowsingDataRemover how to delete application data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bernhard #2. Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
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/ui/webui/chromeos/login/enterprise_oauth_enrollment_scr een_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/enterprise_oauth_enrollment_scr een_handler.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/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "chrome/browser/browsing_data_helper.h"
14 #include "chrome/browser/browsing_data_remover.h"
13 #include "chrome/browser/chromeos/login/authenticator.h" 15 #include "chrome/browser/chromeos/login/authenticator.h"
14 #include "chrome/browser/chromeos/login/login_utils.h" 16 #include "chrome/browser/chromeos/login/login_utils.h"
15 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h" 17 #include "chrome/browser/net/gaia/gaia_oauth_fetcher.h"
16 #include "chrome/browser/policy/auto_enrollment_client.h" 18 #include "chrome/browser/policy/auto_enrollment_client.h"
17 #include "chrome/browser/policy/enterprise_metrics.h" 19 #include "chrome/browser/policy/enterprise_metrics.h"
18 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
20 #include "chrome/common/net/gaia/gaia_constants.h" 22 #include "chrome/common/net/gaia/gaia_constants.h"
21 #include "chrome/common/net/gaia/gaia_urls.h" 23 #include "chrome/common/net/gaia/gaia_urls.h"
22 #include "chrome/common/net/gaia/google_service_auth_error.h" 24 #include "chrome/common/net/gaia/google_service_auth_error.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 if (browsing_data_remover_) 486 if (browsing_data_remover_)
485 return; 487 return;
486 488
487 Profile* profile = Profile::FromBrowserContext( 489 Profile* profile = Profile::FromBrowserContext(
488 web_ui()->GetWebContents()->GetBrowserContext()); 490 web_ui()->GetWebContents()->GetBrowserContext());
489 browsing_data_remover_ = 491 browsing_data_remover_ =
490 new BrowsingDataRemover(profile, 492 new BrowsingDataRemover(profile,
491 BrowsingDataRemover::EVERYTHING, 493 BrowsingDataRemover::EVERYTHING,
492 base::Time()); 494 base::Time());
493 browsing_data_remover_->AddObserver(this); 495 browsing_data_remover_->AddObserver(this);
494 browsing_data_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA); 496 browsing_data_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA,
497 BrowsingDataHelper::UNPROTECTED_WEB);
Evan Stade 2012/06/01 17:17:02 can you tab this over to line up with the first ar
495 } 498 }
496 499
497 void EnterpriseOAuthEnrollmentScreenHandler::RevokeTokens() { 500 void EnterpriseOAuthEnrollmentScreenHandler::RevokeTokens() {
498 Profile* profile = Profile::FromBrowserContext( 501 Profile* profile = Profile::FromBrowserContext(
499 web_ui()->GetWebContents()->GetBrowserContext()); 502 web_ui()->GetWebContents()->GetBrowserContext());
500 503
501 if (!access_token_.empty()) { 504 if (!access_token_.empty()) {
502 new TokenRevoker(access_token_, access_token_secret_, profile); 505 new TokenRevoker(access_token_, access_token_secret_, profile);
503 access_token_.clear(); 506 access_token_.clear();
504 } 507 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 controller_->OnConfirmationClosed(back_to_signin); 547 controller_->OnConfirmationClosed(back_to_signin);
545 } 548 }
546 549
547 void EnterpriseOAuthEnrollmentScreenHandler::UMAFailure(int sample) { 550 void EnterpriseOAuthEnrollmentScreenHandler::UMAFailure(int sample) {
548 if (is_auto_enrollment_) 551 if (is_auto_enrollment_)
549 sample = policy::kMetricEnrollmentAutoFailed; 552 sample = policy::kMetricEnrollmentAutoFailed;
550 UMA(sample); 553 UMA(sample);
551 } 554 }
552 555
553 } // namespace chromeos 556 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698