| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/first_run/first_run.h" | 9 #include "chrome/browser/first_run/first_run.h" |
| 10 #include "chrome/browser/search_engines/util.h" | 10 #include "chrome/browser/search_engines/util.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_list.h" | 12 #include "chrome/browser/ui/browser_list.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/browser/ui/views/window.h" |
| 14 #include "content/browser/user_metrics.h" | 15 #include "content/browser/user_metrics.h" |
| 15 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
| 16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 17 #include "grit/locale_settings.h" | 18 #include "grit/locale_settings.h" |
| 18 #include "grit/theme_resources_standard.h" | 19 #include "grit/theme_resources_standard.h" |
| 19 #include "ui/base/l10n/l10n_font_util.h" | 20 #include "ui/base/l10n/l10n_font_util.h" |
| 20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/views/events/event.h" | 23 #include "ui/views/events/event.h" |
| 23 #include "ui/views/layout/grid_layout.h" | 24 #include "ui/views/layout/grid_layout.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 FirstRunBubble* FirstRunBubble::ShowBubble( | 39 FirstRunBubble* FirstRunBubble::ShowBubble( |
| 39 Profile* profile, | 40 Profile* profile, |
| 40 views::View* anchor_view, | 41 views::View* anchor_view, |
| 41 views::BubbleBorder::ArrowLocation arrow_location, | 42 views::BubbleBorder::ArrowLocation arrow_location, |
| 42 FirstRun::BubbleType bubble_type) { | 43 FirstRun::BubbleType bubble_type) { |
| 43 FirstRunBubble* delegate = | 44 FirstRunBubble* delegate = |
| 44 new FirstRunBubble(profile, | 45 new FirstRunBubble(profile, |
| 45 anchor_view, | 46 anchor_view, |
| 46 arrow_location, | 47 arrow_location, |
| 47 bubble_type); | 48 bubble_type); |
| 48 views::BubbleDelegateView::CreateBubble(delegate); | 49 browser::CreateViewsBubble(delegate); |
| 49 delegate->StartFade(true); | 50 delegate->StartFade(true); |
| 50 return delegate; | 51 return delegate; |
| 51 } | 52 } |
| 52 | 53 |
| 53 void FirstRunBubble::Init() { | 54 void FirstRunBubble::Init() { |
| 54 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 55 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 55 const gfx::Font& original_font = rb.GetFont(ResourceBundle::MediumFont); | 56 const gfx::Font& original_font = rb.GetFont(ResourceBundle::MediumFont); |
| 56 const gfx::Font& derived_font = original_font.DeriveFont(2, gfx::Font::BOLD); | 57 const gfx::Font& derived_font = original_font.DeriveFont(2, gfx::Font::BOLD); |
| 57 | 58 |
| 58 views::Label* label1 = new views::Label(l10n_util::GetStringFUTF16( | 59 views::Label* label1 = new views::Label(l10n_util::GetStringFUTF16( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 119 } |
| 119 | 120 |
| 120 void FirstRunBubble::ButtonPressed(views::Button* sender, | 121 void FirstRunBubble::ButtonPressed(views::Button* sender, |
| 121 const views::Event& event) { | 122 const views::Event& event) { |
| 122 if (bubble_type_ == FirstRun::OEM_BUBBLE) { | 123 if (bubble_type_ == FirstRun::OEM_BUBBLE) { |
| 123 UserMetrics::RecordAction( | 124 UserMetrics::RecordAction( |
| 124 UserMetricsAction("FirstRunOEMBubbleView_Clicked")); | 125 UserMetricsAction("FirstRunOEMBubbleView_Clicked")); |
| 125 } | 126 } |
| 126 GetWidget()->Close(); | 127 GetWidget()->Close(); |
| 127 } | 128 } |
| OLD | NEW |