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

Side by Side Diff: chrome/browser/ui/views/first_run_bubble.cc

Issue 14946003: Record first run startup metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/views/first_run_bubble.h" 5 #include "chrome/browser/ui/views/first_run_bubble.h"
6 6
7 #include "chrome/browser/first_run/first_run.h" 7 #include "chrome/browser/first_run/first_run.h"
8 #include "chrome/browser/search_engines/util.h" 8 #include "chrome/browser/search_engines/util.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/chrome_pages.h" 10 #include "chrome/browser/ui/chrome_pages.h"
11 #include "grit/generated_resources.h" 11 #include "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/base/resource/resource_bundle.h" 13 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/views/controls/label.h" 14 #include "ui/views/controls/label.h"
15 #include "ui/views/controls/link.h" 15 #include "ui/views/controls/link.h"
16 #include "ui/views/layout/grid_layout.h" 16 #include "ui/views/layout/grid_layout.h"
17 #include "ui/views/layout/layout_constants.h" 17 #include "ui/views/layout/layout_constants.h"
18 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
19 19
20 namespace { 20 namespace {
21 const int kAnchorVerticalInset = 5; 21 const int kAnchorVerticalInset = 5;
22 const int kTopInset = 1; 22 const int kTopInset = 1;
23 const int kLeftInset = 2; 23 const int kLeftInset = 2;
24 const int kBottomInset = 7; 24 const int kBottomInset = 7;
25 const int kRightInset = 2; 25 const int kRightInset = 2;
26 } // namespace 26 } // namespace
27 27
28 namespace first_run { 28 namespace first_run {
29 void ShowFirstRunDialog(Profile* profile) {} 29 bool ShowFirstRunDialog(Profile* profile) {
30 // There is no first run dialog on Windows.
31 return false;
32 }
30 } // namespace first_run 33 } // namespace first_run
31 34
32 // static 35 // static
33 FirstRunBubble* FirstRunBubble::ShowBubble(Browser* browser, 36 FirstRunBubble* FirstRunBubble::ShowBubble(Browser* browser,
34 views::View* anchor_view) { 37 views::View* anchor_view) {
35 first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_SHOWN); 38 first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_SHOWN);
36 39
37 FirstRunBubble* delegate = new FirstRunBubble(browser, anchor_view); 40 FirstRunBubble* delegate = new FirstRunBubble(browser, anchor_view);
38 views::BubbleDelegateView::CreateBubble(delegate); 41 views::BubbleDelegateView::CreateBubble(delegate);
39 delegate->StartFade(true); 42 delegate->StartFade(true);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 FirstRunBubble::~FirstRunBubble() { 92 FirstRunBubble::~FirstRunBubble() {
90 } 93 }
91 94
92 void FirstRunBubble::LinkClicked(views::Link* source, int event_flags) { 95 void FirstRunBubble::LinkClicked(views::Link* source, int event_flags) {
93 first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_CHANGE_INVOKED); 96 first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_CHANGE_INVOKED);
94 97
95 GetWidget()->Close(); 98 GetWidget()->Close();
96 if (browser_) 99 if (browser_)
97 chrome::ShowSearchEngineSettings(browser_); 100 chrome::ShowSearchEngineSettings(browser_);
98 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698