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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm

Issue 462853002: Cocoa extension install dialog instrumentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sampling-extensions
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
index 992c8b96b0970742c1069ac2a96f6a7bde87d175..e5c7032e6eac8181f79e5972c48d22f4f6d44df9 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
+#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
@@ -17,6 +18,8 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "content/public/browser/web_contents.h"
+using extensions::ExperienceSamplingEvent;
+
namespace {
void ShowExtensionInstallDialogImpl(
@@ -52,18 +55,26 @@ ExtensionInstallDialogController::ExtensionInstallDialogController(
[[CustomConstrainedWindowSheet alloc] initWithCustomWindow:window]);
constrained_window_.reset(new ConstrainedWindowMac(
this, show_params.parent_web_contents, sheet));
+
+ std::string event_name = "extension_install_dialog_";
+ event_name.append(ExtensionInstallPrompt::PromptTypeToString(prompt->type());
groby-ooo-7-16 2014/08/14 18:00:05 Is this a constant shared with other platforms? In
Chris Thompson 2014/08/14 18:06:21 Done. I've moved it out to the main ExperienceSamp
+ sampling_event_ = ExperienceSamplingEvent::Create(event_name);
}
ExtensionInstallDialogController::~ExtensionInstallDialogController() {
}
void ExtensionInstallDialogController::InstallUIProceed() {
+ if (sampling_event_.get())
groby-ooo-7-16 2014/08/14 18:00:05 No need to check - it's set in the ctor.
Chris Thompson 2014/08/14 18:06:20 The Create(event_name) call can return an empty sc
groby-ooo-7-16 2014/08/14 18:34:05 In that case, mind leaving a quick comment at the
Chris Thompson 2014/08/14 19:51:47 Done (on upstream CL).
+ sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kProceed);
delegate_->InstallUIProceed();
groby-ooo-7-16 2014/08/14 18:00:05 Shouldn't the delegate handle this, so you can be
Chris Thompson 2014/08/14 18:06:21 I looked into the delegate classes for extension i
delegate_ = NULL;
constrained_window_->CloseWebContentsModalDialog();
}
void ExtensionInstallDialogController::InstallUIAbort(bool user_initiated) {
+ if (sampling_event_.get())
groby-ooo-7-16 2014/08/14 18:00:05 see above
Chris Thompson 2014/08/14 18:06:21 Acknowledged.
+ sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
delegate_->InstallUIAbort(user_initiated);
delegate_ = NULL;
constrained_window_->CloseWebContentsModalDialog();

Powered by Google App Engine
This is Rietveld 408576698