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

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

Issue 8609002: CrOs: Remove 16 exit time destructors and 11 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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) 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/create_application_shortcut_view.h" 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (!description_text.empty()) { 102 if (!description_text.empty()) {
103 PrepareDescriptionLabel(description_text); 103 PrepareDescriptionLabel(description_text);
104 } 104 }
105 105
106 SetupLayout(); 106 SetupLayout();
107 } 107 }
108 108
109 void AppInfoView::PrepareDescriptionLabel(const string16& description) { 109 void AppInfoView::PrepareDescriptionLabel(const string16& description) {
110 DCHECK(!description.empty()); 110 DCHECK(!description.empty());
111 111
112 static const size_t kMaxLength = 200; 112 const size_t kMaxLength = 200;
113 static const string16 kEllipsis(ASCIIToUTF16(" ... ")); 113 const string16 kEllipsis(ASCIIToUTF16(" ... "));
Ryan Sleevi 2011/11/20 23:10:49 Same here (const char16 ...[] = { ' ', '.', '.', '
Nico 2011/11/20 23:12:59 I doubt this is a hotspot.
114 114
115 string16 text = description; 115 string16 text = description;
116 if (text.length() > kMaxLength) { 116 if (text.length() > kMaxLength) {
117 text = text.substr(0, kMaxLength); 117 text = text.substr(0, kMaxLength);
118 text += kEllipsis; 118 text += kEllipsis;
119 } 119 }
120 120
121 if (description_) { 121 if (description_) {
122 description_->SetText(text); 122 description_->SetText(text);
123 } else { 123 } else {
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // Called by tracker_ when the app's icon is loaded. 523 // Called by tracker_ when the app's icon is loaded.
524 void CreateChromeApplicationShortcutView::OnImageLoaded( 524 void CreateChromeApplicationShortcutView::OnImageLoaded(
525 SkBitmap* image, const ExtensionResource& resource, int index) { 525 SkBitmap* image, const ExtensionResource& resource, int index) {
526 if (!image || image->isNull()) 526 if (!image || image->isNull())
527 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); 527 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON);
528 528
529 shortcut_info_.favicon = *image; 529 shortcut_info_.favicon = *image;
530 CHECK(app_info_); 530 CHECK(app_info_);
531 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); 531 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
532 } 532 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698