| 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/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
| 10 #include "app/gfx/color_utils.h" | 10 #include "app/gfx/color_utils.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 expanded_view_(false), | 52 expanded_view_(false), |
| 53 signaled_(false), | 53 signaled_(false), |
| 54 parent_(parent), | 54 parent_(parent), |
| 55 root_window_(root_window) { | 55 root_window_(root_window) { |
| 56 InitializeViewResources(); | 56 InitializeViewResources(); |
| 57 expanded_view_ = g_browser_process->local_state()-> | 57 expanded_view_ = g_browser_process->local_state()-> |
| 58 GetBoolean(prefs::kCookiePromptExpanded); | 58 GetBoolean(prefs::kCookiePromptExpanded); |
| 59 } | 59 } |
| 60 | 60 |
| 61 CookiePromptView::~CookiePromptView() { | 61 CookiePromptView::~CookiePromptView() { |
| 62 delete parent_; | |
| 63 } | 62 } |
| 64 | 63 |
| 65 /////////////////////////////////////////////////////////////////////////////// | 64 /////////////////////////////////////////////////////////////////////////////// |
| 66 // CookiePromptView, views::View overrides: | 65 // CookiePromptView, views::View overrides: |
| 67 | 66 |
| 68 gfx::Size CookiePromptView::GetPreferredSize() { | 67 gfx::Size CookiePromptView::GetPreferredSize() { |
| 69 gfx::Size client_size = views::View::GetPreferredSize(); | 68 gfx::Size client_size = views::View::GetPreferredSize(); |
| 70 return gfx::Size(client_size.width(), | 69 return gfx::Size(client_size.width(), |
| 71 client_size.height() + GetExtendedViewHeight()); | 70 client_size.height() + GetExtendedViewHeight()); |
| 72 } | 71 } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 281 } |
| 283 | 282 |
| 284 void CookiePromptView::InitializeViewResources() { | 283 void CookiePromptView::InitializeViewResources() { |
| 285 CookiePromptModalDialog::DialogType type = parent_->dialog_type(); | 284 CookiePromptModalDialog::DialogType type = parent_->dialog_type(); |
| 286 title_ = l10n_util::GetStringF( | 285 title_ = l10n_util::GetStringF( |
| 287 type == CookiePromptModalDialog::DIALOG_TYPE_COOKIE ? | 286 type == CookiePromptModalDialog::DIALOG_TYPE_COOKIE ? |
| 288 IDS_COOKIE_ALERT_TITLE : IDS_DATA_ALERT_TITLE, | 287 IDS_COOKIE_ALERT_TITLE : IDS_DATA_ALERT_TITLE, |
| 289 UTF8ToWide(parent_->origin().host())); | 288 UTF8ToWide(parent_->origin().host())); |
| 290 } | 289 } |
| 291 | 290 |
| OLD | NEW |