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

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

Issue 10898002: Refactor BrowsingDataRemover creation for clarity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac Created 8 years, 3 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"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 void EnterpriseOAuthEnrollmentScreenHandler::ResetAuth() { 485 void EnterpriseOAuthEnrollmentScreenHandler::ResetAuth() {
486 oauth_fetcher_.reset(); 486 oauth_fetcher_.reset();
487 487
488 if (browsing_data_remover_) 488 if (browsing_data_remover_)
489 return; 489 return;
490 490
491 Profile* profile = Profile::FromBrowserContext( 491 Profile* profile = Profile::FromBrowserContext(
492 web_ui()->GetWebContents()->GetBrowserContext()); 492 web_ui()->GetWebContents()->GetBrowserContext());
493 browsing_data_remover_ = 493 browsing_data_remover_ =
494 new BrowsingDataRemover(profile, 494 BrowsingDataRemover::CreateForUnboundedRange(profile);
495 BrowsingDataRemover::EVERYTHING,
496 base::Time::Now());
497 browsing_data_remover_->AddObserver(this); 495 browsing_data_remover_->AddObserver(this);
498 browsing_data_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA, 496 browsing_data_remover_->Remove(BrowsingDataRemover::REMOVE_SITE_DATA,
499 BrowsingDataHelper::UNPROTECTED_WEB); 497 BrowsingDataHelper::UNPROTECTED_WEB);
500 } 498 }
501 499
502 void EnterpriseOAuthEnrollmentScreenHandler::RevokeTokens() { 500 void EnterpriseOAuthEnrollmentScreenHandler::RevokeTokens() {
503 Profile* profile = Profile::FromBrowserContext( 501 Profile* profile = Profile::FromBrowserContext(
504 web_ui()->GetWebContents()->GetBrowserContext()); 502 web_ui()->GetWebContents()->GetBrowserContext());
505 503
506 if (!access_token_.empty()) { 504 if (!access_token_.empty()) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 controller_->OnConfirmationClosed(back_to_signin); 547 controller_->OnConfirmationClosed(back_to_signin);
550 } 548 }
551 549
552 void EnterpriseOAuthEnrollmentScreenHandler::UMAFailure(int sample) { 550 void EnterpriseOAuthEnrollmentScreenHandler::UMAFailure(int sample) {
553 if (is_auto_enrollment_) 551 if (is_auto_enrollment_)
554 sample = policy::kMetricEnrollmentAutoFailed; 552 sample = policy::kMetricEnrollmentAutoFailed;
555 UMA(sample); 553 UMA(sample);
556 } 554 }
557 555
558 } // namespace chromeos 556 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698