OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/cookie_modal_dialog.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/browser/views/cookie_prompt_view.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "views/window/window.h" |
| 11 |
| 12 |
| 13 // TODO(zelidrag): Make this work on Linux (views). |
| 14 |
| 15 int CookiePromptModalDialog::GetDialogButtons() { |
| 16 #if defined(OS_WIN) |
| 17 return dialog_->GetDialogButtons(); |
| 18 #else |
| 19 return 0; |
| 20 #endif |
| 21 } |
| 22 |
| 23 void CookiePromptModalDialog::AcceptWindow() { |
| 24 #if defined(OS_WIN) |
| 25 views::DialogClientView* client_view = |
| 26 dialog_->window()->GetClientView()->AsDialogClientView(); |
| 27 client_view->AcceptWindow(); |
| 28 #endif |
| 29 } |
| 30 |
| 31 void CookiePromptModalDialog::CancelWindow() { |
| 32 #if defined(OS_WIN) |
| 33 views::DialogClientView* client_view = |
| 34 dialog_->window()->GetClientView()->AsDialogClientView(); |
| 35 client_view->CancelWindow(); |
| 36 #endif |
| 37 } |
| 38 |
| 39 |
| 40 NativeDialog CookiePromptModalDialog::CreateNativeDialog() { |
| 41 #if defined(OS_WIN) |
| 42 if (cookie_ui_) { |
| 43 return new CookiePromptView(this, |
| 44 tab_contents_->GetMessageBoxRootWindow(), |
| 45 tab_contents_->profile(), |
| 46 url_, cookie_line_, delegate_); |
| 47 } |
| 48 return new CookiePromptView(this, |
| 49 tab_contents_->GetMessageBoxRootWindow(), |
| 50 tab_contents_->profile(), |
| 51 storage_info_, delegate_); |
| 52 #else |
| 53 return NULL; |
| 54 #endif |
| 55 } |
OLD | NEW |