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

Unified Diff: chrome/browser/ui/views/toolbar/site_chip_view.cc

Issue 110893004: [SiteChip] Add UMA, finish wiring site chip experiment up to the omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Repair bad 16x16 spacing value merge. Created 7 years 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
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/site_chip_view.cc
diff --git a/chrome/browser/ui/views/toolbar/site_chip_view.cc b/chrome/browser/ui/views/toolbar/site_chip_view.cc
index 4a010ec634cfb4bd8a9d0c7c614ffa34fdb74a6f..db7ced3d61235cdbfe259533db48141f667169ab 100644
--- a/chrome/browser/ui/views/toolbar/site_chip_view.cc
+++ b/chrome/browser/ui/views/toolbar/site_chip_view.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/toolbar/site_chip_view.h"
#include "base/files/file_path.h"
+#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -29,6 +30,7 @@
#include "chrome/common/extensions/manifest_handlers/icons_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
@@ -101,8 +103,8 @@ void SiteChipExtensionIcon::OnExtensionIconImageChanged(
namespace {
const int kEdgeThickness = 5;
-const int k16x16IconLeadingSpacing = 3;
-const int k16x16IconTrailingSpacing = 3;
+const int k16x16IconLeadingSpacing = 1;
+const int k16x16IconTrailingSpacing = 2;
Greg Billock 2013/12/12 20:36:37 This repairs a bad merge I must have made at some
const int kIconTextSpacing = 3;
const int kTrailingLabelMargin = 0;
@@ -440,10 +442,12 @@ void SiteChipView::OnPaint(gfx::Canvas* canvas) {
// this button.
void SiteChipView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
+ UMA_HISTOGRAM_COUNTS("SiteChip.Pressed", 1);
msw 2013/12/12 21:09:54 Is this worthwhile if you'll have the SiteChipPres
Greg Billock 2013/12/12 21:55:31 I'm not sure. I thought the user actions just go i
+ content::RecordAction(content::UserMetricsAction("SiteChipPress"));
msw 2013/12/12 21:09:54 According to the guide: https://wiki.corp.google.c
Greg Billock 2013/12/12 21:55:31 Thanks. I haven't used these user actions before.
toolbar_view_->location_bar()->GetOmniboxView()->SetFocus();
- toolbar_view_->location_bar()->GetOmniboxView()->SelectAll(true);
toolbar_view_->location_bar()->GetOmniboxView()->model()->
SetCaretVisibility(true);
+ toolbar_view_->location_bar()->GetOmniboxView()->ShowURL();
}
void SiteChipView::WriteDragDataForView(View* sender,
« no previous file with comments | « chrome/browser/ui/omnibox/omnibox_view.h ('k') | chrome/browser/ui/views/toolbar/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698