| 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/cookie_prompt_view.h" | 5 #include "chrome/browser/views/cookie_prompt_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 LocalStorageSetItemInfoView* view = new LocalStorageSetItemInfoView(); | 233 LocalStorageSetItemInfoView* view = new LocalStorageSetItemInfoView(); |
| 234 layout->AddView(view, 1, 1, GridLayout::FILL, GridLayout::CENTER); | 234 layout->AddView(view, 1, 1, GridLayout::FILL, GridLayout::CENTER); |
| 235 view->SetFields(parent_->origin().host(), | 235 view->SetFields(parent_->origin().host(), |
| 236 parent_->local_storage_key(), | 236 parent_->local_storage_key(), |
| 237 parent_->local_storage_value()); | 237 parent_->local_storage_value()); |
| 238 info_view_ = view; | 238 info_view_ = view; |
| 239 } else if (type == CookiePromptModalDialog::DIALOG_TYPE_DATABASE) { | 239 } else if (type == CookiePromptModalDialog::DIALOG_TYPE_DATABASE) { |
| 240 DatabaseOpenInfoView* view = new DatabaseOpenInfoView(); | 240 DatabaseOpenInfoView* view = new DatabaseOpenInfoView(); |
| 241 layout->AddView(view, 1, 1, GridLayout::FILL, GridLayout::CENTER); | 241 layout->AddView(view, 1, 1, GridLayout::FILL, GridLayout::CENTER); |
| 242 view->SetFields(parent_->origin().host(), | 242 view->SetFields(parent_->origin().host(), |
| 243 parent_->database_name()); | 243 parent_->database_name(), |
| 244 parent_->display_name(), |
| 245 parent_->estimated_size()); |
| 244 info_view_ = view; | 246 info_view_ = view; |
| 245 } else if (type == CookiePromptModalDialog::DIALOG_TYPE_APPCACHE) { | 247 } else if (type == CookiePromptModalDialog::DIALOG_TYPE_APPCACHE) { |
| 246 static const int kAppCacheInfoLabels[] = { | 248 static const int kAppCacheInfoLabels[] = { |
| 247 IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL | 249 IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL |
| 248 }; | 250 }; |
| 249 GenericInfoView* view = new GenericInfoView(ARRAYSIZE(kAppCacheInfoLabels), | 251 GenericInfoView* view = new GenericInfoView(ARRAYSIZE(kAppCacheInfoLabels), |
| 250 kAppCacheInfoLabels); | 252 kAppCacheInfoLabels); |
| 251 layout->AddView(view, 1, 1, GridLayout::FILL, GridLayout::CENTER); | 253 layout->AddView(view, 1, 1, GridLayout::FILL, GridLayout::CENTER); |
| 252 view->SetValue(0, UTF8ToUTF16(parent_->appcache_manifest_url().spec())); | 254 view->SetValue(0, UTF8ToUTF16(parent_->appcache_manifest_url().spec())); |
| 253 info_view_ = view; | 255 info_view_ = view; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 288 } |
| 287 | 289 |
| 288 void CookiePromptView::InitializeViewResources() { | 290 void CookiePromptView::InitializeViewResources() { |
| 289 CookiePromptModalDialog::DialogType type = parent_->dialog_type(); | 291 CookiePromptModalDialog::DialogType type = parent_->dialog_type(); |
| 290 title_ = l10n_util::GetStringF( | 292 title_ = l10n_util::GetStringF( |
| 291 type == CookiePromptModalDialog::DIALOG_TYPE_COOKIE ? | 293 type == CookiePromptModalDialog::DIALOG_TYPE_COOKIE ? |
| 292 IDS_COOKIE_ALERT_TITLE : IDS_DATA_ALERT_TITLE, | 294 IDS_COOKIE_ALERT_TITLE : IDS_DATA_ALERT_TITLE, |
| 293 UTF8ToWide(parent_->origin().host())); | 295 UTF8ToWide(parent_->origin().host())); |
| 294 } | 296 } |
| 295 | 297 |
| OLD | NEW |