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

Unified Diff: chrome/browser/cookie_modal_dialog_views.cc

Issue 560030: Refactored out JS specific part of modal dialog stack into its own class, exp... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cookie_modal_dialog.cc ('k') | chrome/browser/cookie_prompt_modal_dialog_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cookie_modal_dialog_views.cc
===================================================================
--- chrome/browser/cookie_modal_dialog_views.cc (revision 0)
+++ chrome/browser/cookie_modal_dialog_views.cc (revision 0)
@@ -0,0 +1,55 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/cookie_modal_dialog.h"
+
+#include "base/logging.h"
+#include "chrome/browser/views/cookie_prompt_view.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "views/window/window.h"
+
+
+// TODO(zelidrag): Make this work on Linux (views).
+
+int CookiePromptModalDialog::GetDialogButtons() {
+#if defined(OS_WIN)
+ return dialog_->GetDialogButtons();
+#else
+ return 0;
+#endif
+}
+
+void CookiePromptModalDialog::AcceptWindow() {
+#if defined(OS_WIN)
+ views::DialogClientView* client_view =
+ dialog_->window()->GetClientView()->AsDialogClientView();
+ client_view->AcceptWindow();
+#endif
+}
+
+void CookiePromptModalDialog::CancelWindow() {
+#if defined(OS_WIN)
+ views::DialogClientView* client_view =
+ dialog_->window()->GetClientView()->AsDialogClientView();
+ client_view->CancelWindow();
+#endif
+}
+
+
+NativeDialog CookiePromptModalDialog::CreateNativeDialog() {
+#if defined(OS_WIN)
+ if (cookie_ui_) {
+ return new CookiePromptView(this,
+ tab_contents_->GetMessageBoxRootWindow(),
+ tab_contents_->profile(),
+ url_, cookie_line_, delegate_);
+ }
+ return new CookiePromptView(this,
+ tab_contents_->GetMessageBoxRootWindow(),
+ tab_contents_->profile(),
+ storage_info_, delegate_);
+#else
+ return NULL;
+#endif
+}
Property changes on: chrome/browser/cookie_modal_dialog_views.cc
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cookie_modal_dialog.cc ('k') | chrome/browser/cookie_prompt_modal_dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698