Chromium Code Reviews| Index: chrome/browser/ui/views/first_run_bubble.cc |
| diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc |
| index 0d98e491fff6e73a961e921ffae419c80557653b..6ea9cdf461fd6e544cfecfcca2df1dde8f005fb0 100644 |
| --- a/chrome/browser/ui/views/first_run_bubble.cc |
| +++ b/chrome/browser/ui/views/first_run_bubble.cc |
| @@ -4,9 +4,9 @@ |
| #include "chrome/browser/ui/views/first_run_bubble.h" |
| -#include "base/utf_string_conversions.h" |
| #include "chrome/browser/first_run/first_run.h" |
| #include "chrome/browser/search_engines/util.h" |
| +#include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/chrome_pages.h" |
| #include "grit/generated_resources.h" |
| #include "ui/base/l10n/l10n_util.h" |
| @@ -26,16 +26,15 @@ const int kRightInset = 2; |
| } // namespace |
| namespace first_run { |
| - void ShowFirstRunDialog(Profile* profile) {} |
| +void ShowFirstRunDialog(Profile* profile) {} |
| } // namespace first_run |
| // static |
| FirstRunBubble* FirstRunBubble::ShowBubble(Browser* browser, |
| - Profile* profile, |
| views::View* anchor_view) { |
| first_run::LogFirstRunMetric(first_run::FIRST_RUN_BUBBLE_SHOWN); |
| - FirstRunBubble* delegate = new FirstRunBubble(browser, profile, anchor_view); |
| + FirstRunBubble* delegate = new FirstRunBubble(browser, anchor_view); |
| views::BubbleDelegateView::CreateBubble(delegate); |
| delegate->StartFade(true); |
| return delegate; |
| @@ -45,8 +44,12 @@ void FirstRunBubble::Init() { |
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| const gfx::Font& original_font = rb.GetFont(ui::ResourceBundle::MediumFont); |
| + string16 search_engine_name; |
| + if (browser_) |
| + search_engine_name = GetDefaultSearchEngineName(browser_->profile()); |
| + |
| views::Label* title = new views::Label(l10n_util::GetStringFUTF16( |
| - IDS_FR_BUBBLE_TITLE, GetDefaultSearchEngineName(profile_))); |
| + IDS_FR_BUBBLE_TITLE, search_engine_name)); |
|
Peter Kasting
2012/08/11 22:52:40
Nit: If you inline, you can avoid the temp above:
|
| title->SetFont(original_font.DeriveFont(2, gfx::Font::BOLD)); |
| views::Link* change = |
| @@ -85,12 +88,9 @@ gfx::Rect FirstRunBubble::GetAnchorRect() { |
| return rect; |
| } |
| -FirstRunBubble::FirstRunBubble(Browser* browser, |
| - Profile* profile, |
| - views::View* anchor_view) |
| +FirstRunBubble::FirstRunBubble(Browser* browser, views::View* anchor_view) |
| : views::BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT), |
| - browser_(browser), |
| - profile_(profile) { |
| + browser_(browser) { |
| } |
| FirstRunBubble::~FirstRunBubble() { |