OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/extensions/extension_installed_bubble.h" | 5 #include "chrome/browser/views/extensions/extension_installed_bubble.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (size.width() > kIconSize || size.height() > kIconSize) | 78 if (size.width() > kIconSize || size.height() > kIconSize) |
79 size = gfx::Size(kIconSize, kIconSize); | 79 size = gfx::Size(kIconSize, kIconSize); |
80 icon_ = new views::ImageView(); | 80 icon_ = new views::ImageView(); |
81 icon_->SetImageSize(size); | 81 icon_->SetImageSize(size); |
82 icon_->SetImage(*icon); | 82 icon_->SetImage(*icon); |
83 AddChildView(icon_); | 83 AddChildView(icon_); |
84 | 84 |
85 heading_ = new views::Label( | 85 heading_ = new views::Label( |
86 l10n_util::GetStringF(IDS_EXTENSION_INSTALLED_HEADING, | 86 l10n_util::GetStringF(IDS_EXTENSION_INSTALLED_HEADING, |
87 UTF8ToWide(extension->name()))); | 87 UTF8ToWide(extension->name()))); |
88 heading_->SetFont(font.DeriveFont(3, gfx::Font::NORMAL)); | 88 heading_->SetFont(rb.GetFont(ResourceBundle::MediumFont)); |
89 heading_->SetMultiLine(true); | 89 heading_->SetMultiLine(true); |
90 heading_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 90 heading_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
91 AddChildView(heading_); | 91 AddChildView(heading_); |
92 | 92 |
93 if (type_ == ExtensionInstalledBubble::PAGE_ACTION) { | 93 if (type_ == ExtensionInstalledBubble::PAGE_ACTION) { |
94 info_ = new views::Label(l10n_util::GetString( | 94 info_ = new views::Label(l10n_util::GetString( |
95 IDS_EXTENSION_INSTALLED_PAGE_ACTION_INFO)); | 95 IDS_EXTENSION_INSTALLED_PAGE_ACTION_INFO)); |
96 info_->SetFont(font); | 96 info_->SetFont(font); |
97 info_->SetMultiLine(true); | 97 info_->SetMultiLine(true); |
98 info_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 98 info_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 if (extension_ && type_ == PAGE_ACTION) { | 344 if (extension_ && type_ == PAGE_ACTION) { |
345 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( | 345 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( |
346 browser_->window()->GetNativeHandle()); | 346 browser_->window()->GetNativeHandle()); |
347 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( | 347 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( |
348 extension_->page_action(), | 348 extension_->page_action(), |
349 false); // preview_enabled | 349 false); // preview_enabled |
350 } | 350 } |
351 | 351 |
352 Release(); // Balanced in ctor. | 352 Release(); // Balanced in ctor. |
353 } | 353 } |
OLD | NEW |