| OLD | NEW |
| 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/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 void AppInfoView::Init(const base::string16& title_text, | 102 void AppInfoView::Init(const base::string16& title_text, |
| 103 const base::string16& description_text, | 103 const base::string16& description_text, |
| 104 const gfx::ImageFamily& icon) { | 104 const gfx::ImageFamily& icon) { |
| 105 icon_ = new views::ImageView(); | 105 icon_ = new views::ImageView(); |
| 106 UpdateIcon(icon); | 106 UpdateIcon(icon); |
| 107 icon_->SetImageSize(gfx::Size(kIconPreviewSizePixels, | 107 icon_->SetImageSize(gfx::Size(kIconPreviewSizePixels, |
| 108 kIconPreviewSizePixels)); | 108 kIconPreviewSizePixels)); |
| 109 | 109 |
| 110 title_ = new views::Label( | 110 title_ = new views::Label(title_text, views::TextContext::DIALOG_TEXT_SMALL, |
| 111 title_text, | 111 views::TextStyle::EXTENSION_NAME); |
| 112 ui::ResourceBundle::GetSharedInstance().GetFontList( | |
| 113 ui::ResourceBundle::BoldFont)); | |
| 114 title_->SetMultiLine(true); | 112 title_->SetMultiLine(true); |
| 115 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 113 title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 116 | 114 |
| 117 PrepareDescriptionLabel(description_text); | 115 PrepareDescriptionLabel(description_text); |
| 118 | 116 |
| 119 SetupLayout(); | 117 SetupLayout(); |
| 120 } | 118 } |
| 121 | 119 |
| 122 void AppInfoView::PrepareDescriptionLabel(const base::string16& description) { | 120 void AppInfoView::PrepareDescriptionLabel(const base::string16& description) { |
| 123 // Do not make space for the description if it is empty. | 121 // Do not make space for the description if it is empty. |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 bool CreateChromeApplicationShortcutView::Cancel() { | 536 bool CreateChromeApplicationShortcutView::Cancel() { |
| 539 if (!close_callback_.is_null()) | 537 if (!close_callback_.is_null()) |
| 540 close_callback_.Run(false); | 538 close_callback_.Run(false); |
| 541 return CreateApplicationShortcutView::Cancel(); | 539 return CreateApplicationShortcutView::Cancel(); |
| 542 } | 540 } |
| 543 | 541 |
| 544 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( | 542 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( |
| 545 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { | 543 std::unique_ptr<web_app::ShortcutInfo> shortcut_info) { |
| 546 shortcut_info_ = std::move(shortcut_info); | 544 shortcut_info_ = std::move(shortcut_info); |
| 547 } | 545 } |
| OLD | NEW |