summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authormsw@google.com <msw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-19 20:18:16 +0000
committermsw@google.com <msw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-19 20:18:16 +0000
commit22cfe5fa8a8636af6eca91c99ca090cccd9d9dbd (patch)
tree4d9c122bd12cfcafd4ab8a28b86ce58b4638139b /chrome/browser/ui
parentadef225bdf62da1c97aeb9066d72b40a21508fc5 (diff)
downloadchromium_src-22cfe5fa8a8636af6eca91c99ca090cccd9d9dbd.zip
chromium_src-22cfe5fa8a8636af6eca91c99ca090cccd9d9dbd.tar.gz
chromium_src-22cfe5fa8a8636af6eca91c99ca090cccd9d9dbd.tar.bz2
Consolidate UMA metrics reporting for Chrome To Mobile
Add C...Service::Observer to log BUBBLE_SHOWN. Add C...Service::SnapshotGenerated to log SNAPSHOT_[GENERATED|ERROR]. Nix C...Service::LogMetric, move enum to code file. Remove metrics logging from Views, Cocoa, and GTK bubbles. Cleanup CL; no observable behavior change. BUG=102709,120941 TEST=none R=sky@chromium.org,sail@chromium.org,erg@chromium.org Review URL: https://codereview.chromium.org/11195061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163046 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm3
-rw-r--r--chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm7
-rw-r--r--chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.cc3
-rw-r--r--chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc3
4 files changed, 0 insertions, 16 deletions
diff --git a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
index 2f4080a..1816fb1 100644
--- a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller.mm
@@ -108,7 +108,6 @@ void ChromeToMobileBubbleNotificationBridge::OnSendComplete(bool success) {
// Override -[BaseBubbleController showWindow:] to set up UI elements.
- (void)showWindow:(id)sender {
DCHECK(service_->HasMobiles());
- service_->LogMetric(ChromeToMobileService::BUBBLE_SHOWN);
// Force load the NIB.
NSWindow* window = [self window];
@@ -228,12 +227,10 @@ void ChromeToMobileBubbleNotificationBridge::OnSendComplete(bool success) {
snapshotPath_ = path;
NSString* text = nil;
if (bytes > 0) {
- service_->LogMetric(ChromeToMobileService::SNAPSHOT_GENERATED);
[sendCopy_ setEnabled:YES];
text = l10n_util::GetNSStringF(IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY,
ui::FormatBytes(bytes));
} else {
- service_->LogMetric(ChromeToMobileService::SNAPSHOT_ERROR);
text = l10n_util::GetNSString(IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY_FAILED);
}
[sendCopy_ setTitle:text];
diff --git a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
index 534a42f..1ed30fb 100644
--- a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
@@ -26,7 +26,6 @@ class MockChromeToMobileService : public ChromeToMobileService {
Browser* browser,
base::WeakPtr<Observer> observer));
MOCK_METHOD1(DeleteSnapshot, void(const FilePath& snapshot));
- MOCK_CONST_METHOD1(LogMetric, void(ChromeToMobileService::Metric));
// A set of mock mobile devices, kept in lieu of the list in profile prefs.
base::ListValue mobiles_;
@@ -120,7 +119,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, OneDevice) {
EXPECT_CALL(service_, SendToMobile(testing::_, testing::_,
testing::_, testing::_)).Times(0);
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
- EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
service_.AddDevices(1);
CreateBubble();
@@ -132,7 +130,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, TwoDevices) {
EXPECT_CALL(service_, SendToMobile(testing::_, testing::_,
testing::_, testing::_)).Times(0);
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
- EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
service_.AddDevices(2);
CreateBubble();
@@ -144,7 +141,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, ThreeDevices) {
EXPECT_CALL(service_, SendToMobile(testing::_, testing::_,
testing::_, testing::_)).Times(0);
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
- EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
service_.AddDevices(3);
CreateBubble();
@@ -156,7 +152,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, SendWithoutSnapshot) {
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
EXPECT_CALL(service_, SendToMobile(testing::_, path, NULL, testing::_));
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
- EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
service_.AddDevices(1);
CreateBubble();
@@ -168,8 +163,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, SendWithSnapshot) {
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
EXPECT_CALL(service_, SendToMobile(testing::_, path, NULL, testing::_));
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
- EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
- EXPECT_CALL(service_, LogMetric(ChromeToMobileService::SNAPSHOT_GENERATED));
service_.AddDevices(1);
CreateBubble();
diff --git a/chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.cc b/chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.cc
index 87e1b30..870bc7f 100644
--- a/chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.cc
@@ -109,12 +109,10 @@ void ChromeToMobileBubbleGtk::SnapshotGenerated(const FilePath& path,
int64 bytes) {
snapshot_path_ = path;
if (bytes > 0) {
- service_->LogMetric(ChromeToMobileService::SNAPSHOT_GENERATED);
gtk_button_set_label(GTK_BUTTON(send_copy_), l10n_util::GetStringFUTF8(
IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY, ui::FormatBytes(bytes)).c_str());
gtk_widget_set_sensitive(send_copy_, TRUE);
} else {
- service_->LogMetric(ChromeToMobileService::SNAPSHOT_ERROR);
gtk_button_set_label(GTK_BUTTON(send_copy_), l10n_util::GetStringUTF8(
IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY_FAILED).c_str());
}
@@ -151,7 +149,6 @@ ChromeToMobileBubbleGtk::ChromeToMobileBubbleGtk(GtkWidget* anchor_widget,
error_(NULL),
bubble_(NULL) {
DCHECK(service_->HasMobiles());
- service_->LogMetric(ChromeToMobileService::BUBBLE_SHOWN);
// Generate the MHTML snapshot now to report its size in the bubble.
service_->GenerateSnapshot(browser_, weak_ptr_factory_.GetWeakPtr());
diff --git a/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc b/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
index 52b3faf..dffecaf 100644
--- a/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
+++ b/chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc
@@ -179,12 +179,10 @@ void ChromeToMobileBubbleView::SnapshotGenerated(const FilePath& path,
int64 bytes) {
snapshot_path_ = path;
if (bytes > 0) {
- service_->LogMetric(ChromeToMobileService::SNAPSHOT_GENERATED);
send_copy_->SetText(l10n_util::GetStringFUTF16(
IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY, ui::FormatBytes(bytes)));
send_copy_->SetEnabled(true);
} else {
- service_->LogMetric(ChromeToMobileService::SNAPSHOT_ERROR);
send_copy_->SetText(l10n_util::GetStringUTF16(
IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY_FAILED));
}
@@ -218,7 +216,6 @@ void ChromeToMobileBubbleView::OnSendComplete(bool success) {
void ChromeToMobileBubbleView::Init() {
DCHECK(service_->HasMobiles());
- service_->LogMetric(ChromeToMobileService::BUBBLE_SHOWN);
GridLayout* layout = new GridLayout(this);
SetLayoutManager(layout);