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

Side by Side Diff: chrome/browser/gtk/gtk_chrome_cookie_view.cc

Issue 3107021: Convert FormatBytes to string16. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 months 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
OLDNEW
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/gtk/gtk_chrome_cookie_view.h" 5 #include "chrome/browser/gtk/gtk_chrome_cookie_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/i18n/time_formatting.h" 8 #include "base/i18n/time_formatting.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/gtk/gtk_util.h" 10 #include "chrome/browser/gtk/gtk_util.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 gtk_entry_set_text( 506 gtk_entry_set_text(
507 GTK_ENTRY(self->database_name_entry_), 507 GTK_ENTRY(self->database_name_entry_),
508 database_info.database_name.empty() ? 508 database_info.database_name.empty() ?
509 l10n_util::GetStringUTF8( 509 l10n_util::GetStringUTF8(
510 IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME).c_str() : 510 IDS_COOKIES_WEB_DATABASE_UNNAMED_NAME).c_str() :
511 database_info.database_name.c_str()); 511 database_info.database_name.c_str());
512 gtk_entry_set_text(GTK_ENTRY(self->database_description_entry_), 512 gtk_entry_set_text(GTK_ENTRY(self->database_description_entry_),
513 database_info.description.c_str()); 513 database_info.description.c_str());
514 gtk_entry_set_text(GTK_ENTRY(self->database_size_entry_), 514 gtk_entry_set_text(GTK_ENTRY(self->database_size_entry_),
515 WideToUTF8(FormatBytes( 515 UTF16ToUTF8(FormatBytes(
516 database_info.size, 516 database_info.size,
517 GetByteDisplayUnits(database_info.size), 517 GetByteDisplayUnits(database_info.size),
518 true)).c_str()); 518 true)).c_str());
519 gtk_entry_set_text(GTK_ENTRY(self->database_last_modified_entry_), 519 gtk_entry_set_text(GTK_ENTRY(self->database_last_modified_entry_),
520 WideToUTF8(base::TimeFormatFriendlyDateAndTime( 520 WideToUTF8(base::TimeFormatFriendlyDateAndTime(
521 database_info.last_modified)).c_str()); 521 database_info.last_modified)).c_str());
522 SetDatabaseDetailsSensitivity(self, TRUE); 522 SetDatabaseDetailsSensitivity(self, TRUE);
523 } 523 }
524 524
525 // Switches the display to showing the passed in local storage data. 525 // Switches the display to showing the passed in local storage data.
526 void gtk_chrome_cookie_view_display_local_storage( 526 void gtk_chrome_cookie_view_display_local_storage(
527 GtkChromeCookieView* self, 527 GtkChromeCookieView* self,
528 const BrowsingDataLocalStorageHelper::LocalStorageInfo& 528 const BrowsingDataLocalStorageHelper::LocalStorageInfo&
529 local_storage_info) { 529 local_storage_info) {
530 UpdateVisibleDetailedInfo(self, self->local_storage_details_table_); 530 UpdateVisibleDetailedInfo(self, self->local_storage_details_table_);
531 531
532 gtk_entry_set_text(GTK_ENTRY(self->local_storage_origin_entry_), 532 gtk_entry_set_text(GTK_ENTRY(self->local_storage_origin_entry_),
533 local_storage_info.origin.c_str()); 533 local_storage_info.origin.c_str());
534 gtk_entry_set_text(GTK_ENTRY(self->local_storage_size_entry_), 534 gtk_entry_set_text(GTK_ENTRY(self->local_storage_size_entry_),
535 WideToUTF8(FormatBytes( 535 UTF16ToUTF8(FormatBytes(
536 local_storage_info.size, 536 local_storage_info.size,
537 GetByteDisplayUnits(local_storage_info.size), 537 GetByteDisplayUnits(local_storage_info.size),
538 true)).c_str()); 538 true)).c_str());
539 gtk_entry_set_text(GTK_ENTRY(self->local_storage_last_modified_entry_), 539 gtk_entry_set_text(GTK_ENTRY(self->local_storage_last_modified_entry_),
540 WideToUTF8(base::TimeFormatFriendlyDateAndTime( 540 WideToUTF8(base::TimeFormatFriendlyDateAndTime(
541 local_storage_info.last_modified)).c_str()); 541 local_storage_info.last_modified)).c_str());
542 SetLocalStorageDetailsSensitivity(self, TRUE); 542 SetLocalStorageDetailsSensitivity(self, TRUE);
543 } 543 }
544 544
545 // Switches the display to showing the passed in app cache. 545 // Switches the display to showing the passed in app cache.
546 void gtk_chrome_cookie_view_display_app_cache( 546 void gtk_chrome_cookie_view_display_app_cache(
547 GtkChromeCookieView* self, 547 GtkChromeCookieView* self,
548 const appcache::AppCacheInfo& info) { 548 const appcache::AppCacheInfo& info) {
549 UpdateVisibleDetailedInfo(self, self->appcache_details_table_); 549 UpdateVisibleDetailedInfo(self, self->appcache_details_table_);
550 550
551 gtk_entry_set_text(GTK_ENTRY(self->appcache_manifest_entry_), 551 gtk_entry_set_text(GTK_ENTRY(self->appcache_manifest_entry_),
552 info.manifest_url.spec().c_str()); 552 info.manifest_url.spec().c_str());
553 gtk_entry_set_text(GTK_ENTRY(self->appcache_size_entry_), 553 gtk_entry_set_text(GTK_ENTRY(self->appcache_size_entry_),
554 WideToUTF8(FormatBytes( 554 UTF16ToUTF8(FormatBytes(
555 info.size, 555 info.size,
556 GetByteDisplayUnits(info.size), 556 GetByteDisplayUnits(info.size),
557 true)).c_str()); 557 true)).c_str());
558 gtk_entry_set_text(GTK_ENTRY(self->appcache_created_entry_), 558 gtk_entry_set_text(GTK_ENTRY(self->appcache_created_entry_),
559 WideToUTF8(base::TimeFormatFriendlyDateAndTime( 559 WideToUTF8(base::TimeFormatFriendlyDateAndTime(
560 info.creation_time)).c_str()); 560 info.creation_time)).c_str());
561 gtk_entry_set_text(GTK_ENTRY(self->appcache_last_accessed_entry_), 561 gtk_entry_set_text(GTK_ENTRY(self->appcache_last_accessed_entry_),
562 WideToUTF8(base::TimeFormatFriendlyDateAndTime( 562 WideToUTF8(base::TimeFormatFriendlyDateAndTime(
563 info.last_access_time)).c_str()); 563 info.last_access_time)).c_str());
564 SetAppCacheDetailsSensitivity(self, TRUE); 564 SetAppCacheDetailsSensitivity(self, TRUE);
(...skipping 23 matching lines...) Expand all
588 unsigned long estimated_size) { 588 unsigned long estimated_size) {
589 UpdateVisibleDetailedInfo(self, self->database_accessed_table_); 589 UpdateVisibleDetailedInfo(self, self->database_accessed_table_);
590 590
591 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_origin_entry_), 591 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_origin_entry_),
592 host.c_str()); 592 host.c_str());
593 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_name_entry_), 593 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_name_entry_),
594 UTF16ToUTF8(database_name).c_str()); 594 UTF16ToUTF8(database_name).c_str());
595 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_description_entry_), 595 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_description_entry_),
596 UTF16ToUTF8(display_name).c_str()); 596 UTF16ToUTF8(display_name).c_str());
597 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_size_entry_), 597 gtk_entry_set_text(GTK_ENTRY(self->database_accessed_size_entry_),
598 WideToUTF8(FormatBytes( 598 UTF16ToUTF8(FormatBytes(
599 estimated_size, 599 estimated_size,
600 GetByteDisplayUnits(estimated_size), 600 GetByteDisplayUnits(estimated_size),
601 true)).c_str()); 601 true)).c_str());
602 SetDatabaseAccessedSensitivity(self, TRUE); 602 SetDatabaseAccessedSensitivity(self, TRUE);
603 } 603 }
604 604
605 void gtk_chrome_cookie_view_display_appcache_created( 605 void gtk_chrome_cookie_view_display_appcache_created(
606 GtkChromeCookieView* self, 606 GtkChromeCookieView* self,
607 const GURL& manifest_url) { 607 const GURL& manifest_url) {
608 UpdateVisibleDetailedInfo(self, self->appcache_created_table_); 608 UpdateVisibleDetailedInfo(self, self->appcache_created_table_);
(...skipping 10 matching lines...) Expand all
619 int store_size = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL); 619 int store_size = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), NULL);
620 if (store_size == 1) 620 if (store_size == 1)
621 return false; 621 return false;
622 622
623 DCHECK_EQ(2, store_size); 623 DCHECK_EQ(2, store_size);
624 624
625 int selected = gtk_combo_box_get_active(GTK_COMBO_BOX( 625 int selected = gtk_combo_box_get_active(GTK_COMBO_BOX(
626 self->cookie_expires_combobox_)); 626 self->cookie_expires_combobox_));
627 return selected == 1; 627 return selected == 1;
628 } 628 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698