| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/ui/idle_app_name_notification_view.h" | 5 #include "chrome/browser/chromeos/ui/idle_app_name_notification_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void IdleAppNameNotificationView::ShowMessage( | 277 void IdleAppNameNotificationView::ShowMessage( |
| 278 int message_visibility_time_in_ms, | 278 int message_visibility_time_in_ms, |
| 279 int animation_time_ms, | 279 int animation_time_ms, |
| 280 const extensions::Extension* extension) { | 280 const extensions::Extension* extension) { |
| 281 DCHECK(!view_); | 281 DCHECK(!view_); |
| 282 | 282 |
| 283 base::string16 author; | 283 base::string16 author; |
| 284 base::string16 app_name; | 284 base::string16 app_name; |
| 285 bool error = false; | 285 bool error = false; |
| 286 if (extension && !ContainsOnlyWhitespaceASCII(extension->name())) { | 286 if (extension && !ContainsOnlyWhitespaceASCII(extension->name())) { |
| 287 app_name = base::ASCIIToUTF16(extension->name()); | 287 app_name = base::UTF8ToUTF16(extension->name()); |
| 288 // TODO(skuhne): This might not be enough since the author flag is not | 288 // TODO(skuhne): This might not be enough since the author flag is not |
| 289 // explicitly enforced by us, but for Kiosk mode we could maybe require it. | 289 // explicitly enforced by us, but for Kiosk mode we could maybe require it. |
| 290 extension->manifest()->GetString("author", &author); | 290 extension->manifest()->GetString("author", &author); |
| 291 if (ContainsOnlyWhitespace(author)) { | 291 if (ContainsOnlyWhitespace(author)) { |
| 292 error = true; | 292 error = true; |
| 293 author = l10n_util::GetStringUTF16( | 293 author = l10n_util::GetStringUTF16( |
| 294 IDS_IDLE_APP_NAME_INVALID_AUTHOR_NOTIFICATION); | 294 IDS_IDLE_APP_NAME_INVALID_AUTHOR_NOTIFICATION); |
| 295 } | 295 } |
| 296 } else { | 296 } else { |
| 297 error = true; | 297 error = true; |
| 298 app_name = l10n_util::GetStringUTF16( | 298 app_name = l10n_util::GetStringUTF16( |
| 299 IDS_IDLE_APP_NAME_UNKNOWN_APPLICATION_NOTIFICATION); | 299 IDS_IDLE_APP_NAME_UNKNOWN_APPLICATION_NOTIFICATION); |
| 300 } | 300 } |
| 301 | 301 |
| 302 view_ = new IdleAppNameNotificationDelegateView( | 302 view_ = new IdleAppNameNotificationDelegateView( |
| 303 this, | 303 this, |
| 304 app_name, | 304 app_name, |
| 305 author, | 305 author, |
| 306 error, | 306 error, |
| 307 message_visibility_time_in_ms + animation_time_ms); | 307 message_visibility_time_in_ms + animation_time_ms); |
| 308 CreateAndShowWidgetWithContent(view_, view_, animation_time_ms); | 308 CreateAndShowWidgetWithContent(view_, view_, animation_time_ms); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace chromeos | 311 } // namespace chromeos |
| OLD | NEW |