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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 274943003: Create new histrograms for ExtensionPermission enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing. Created 6 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
« no previous file with comments | « no previous file | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extensions/api/webstore_private/webstore_private_api.h" 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 approval->authuser = authuser_; 502 approval->authuser = authuser_;
503 g_pending_approvals.Get().PushApproval(approval.Pass()); 503 g_pending_approvals.Get().PushApproval(approval.Pass());
504 504
505 SetResultCode(ERROR_NONE); 505 SetResultCode(ERROR_NONE);
506 SendResponse(true); 506 SendResponse(true);
507 507
508 // The Permissions_Install histogram is recorded from the ExtensionService 508 // The Permissions_Install histogram is recorded from the ExtensionService
509 // for all extension installs, so we only need to record the web store 509 // for all extension installs, so we only need to record the web store
510 // specific histogram here. 510 // specific histogram here.
511 ExtensionService::RecordPermissionMessagesHistogram( 511 ExtensionService::RecordPermissionMessagesHistogram(
512 dummy_extension_.get(), "Extensions.Permissions_WebStoreInstall"); 512 dummy_extension_.get(), "Extensions.Permissions_WebStoreInstall2");
513 513
514 // Matches the AddRef in RunAsync(). 514 // Matches the AddRef in RunAsync().
515 Release(); 515 Release();
516 } 516 }
517 517
518 void WebstorePrivateBeginInstallWithManifest3Function::InstallUIAbort( 518 void WebstorePrivateBeginInstallWithManifest3Function::InstallUIAbort(
519 bool user_initiated) { 519 bool user_initiated) {
520 error_ = kUserCancelledError; 520 error_ = kUserCancelledError;
521 SetResultCode(USER_CANCELLED); 521 SetResultCode(USER_CANCELLED);
522 g_pending_installs.Get().EraseInstall(GetProfile(), params_->details.id); 522 g_pending_installs.Get().EraseInstall(GetProfile(), params_->details.id);
523 SendResponse(false); 523 SendResponse(false);
524 524
525 // The web store install histograms are a subset of the install histograms. 525 // The web store install histograms are a subset of the install histograms.
526 // We need to record both histograms here since CrxInstaller::InstallUIAbort 526 // We need to record both histograms here since CrxInstaller::InstallUIAbort
527 // is never called for web store install cancellations. 527 // is never called for web store install cancellations.
528 std::string histogram_name = user_initiated ? 528 std::string histogram_name =
529 "Extensions.Permissions_WebStoreInstallCancel" : 529 user_initiated ? "Extensions.Permissions_WebStoreInstallCancel2"
530 "Extensions.Permissions_WebStoreInstallAbort"; 530 : "Extensions.Permissions_WebStoreInstallAbort2";
531 ExtensionService::RecordPermissionMessagesHistogram(dummy_extension_.get(), 531 ExtensionService::RecordPermissionMessagesHistogram(dummy_extension_.get(),
532 histogram_name.c_str()); 532 histogram_name.c_str());
533 533
534 histogram_name = user_initiated ? 534 histogram_name = user_initiated ? "Extensions.Permissions_InstallCancel2"
535 "Extensions.Permissions_InstallCancel" : 535 : "Extensions.Permissions_InstallAbort2";
536 "Extensions.Permissions_InstallAbort";
537 ExtensionService::RecordPermissionMessagesHistogram(dummy_extension_.get(), 536 ExtensionService::RecordPermissionMessagesHistogram(dummy_extension_.get(),
538 histogram_name.c_str()); 537 histogram_name.c_str());
539 538
540 // Matches the AddRef in RunAsync(). 539 // Matches the AddRef in RunAsync().
541 Release(); 540 Release();
542 } 541 }
543 542
544 WebstorePrivateCompleteInstallFunction:: 543 WebstorePrivateCompleteInstallFunction::
545 WebstorePrivateCompleteInstallFunction() {} 544 WebstorePrivateCompleteInstallFunction() {}
546 545
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 } else { 811 } else {
813 error_ = "merge_session_failed"; 812 error_ = "merge_session_failed";
814 SendResponse(false); 813 SendResponse(false);
815 } 814 }
816 815
817 SigninManagerFactory::GetInstance()->RemoveObserver(this); 816 SigninManagerFactory::GetInstance()->RemoveObserver(this);
818 Release(); // Balanced in RunAsync(). 817 Release(); // Balanced in RunAsync().
819 } 818 }
820 819
821 } // namespace extensions 820 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698