| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_WEBUI_COLLECTED_COOKIES_UI_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_COLLECTED_COOKIES_UI_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_COLLECTED_COOKIES_UI_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_COLLECTED_COOKIES_UI_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/ui/webui/cookies_tree_model_adapter.h" | 14 #include "chrome/browser/ui/webui/cookies_tree_model_adapter.h" |
| 15 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 15 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 16 #include "chrome/common/content_settings.h" | 16 #include "chrome/common/content_settings.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/web_ui_message_handler.h" |
| 19 | 20 |
| 20 class GURL; | 21 class GURL; |
| 21 class TabContents; | 22 class TabContents; |
| 22 class TabContentsWrapper; | 23 class TabContentsWrapper; |
| 23 | 24 |
| 24 namespace gfx { | 25 namespace gfx { |
| 25 class Size; | 26 class Size; |
| 26 } | 27 } |
| 27 | 28 |
| 28 class CollectedCookiesUIDelegate : public HtmlDialogUIDelegate, | 29 class CollectedCookiesUIDelegate : public HtmlDialogUIDelegate, |
| 29 WebUIMessageHandler, | 30 content::WebUIMessageHandler, |
| 30 content::NotificationObserver { | 31 content::NotificationObserver { |
| 31 public: | 32 public: |
| 32 virtual ~CollectedCookiesUIDelegate(); | 33 virtual ~CollectedCookiesUIDelegate(); |
| 33 | 34 |
| 34 // static factory method that shows CollectedCookiesUI for |tab_contents|. | 35 // static factory method that shows CollectedCookiesUI for |tab_contents|. |
| 35 static void Show(TabContentsWrapper* wrapper); | 36 static void Show(TabContentsWrapper* wrapper); |
| 36 | 37 |
| 37 // HtmlDialogUIDelegate implementation: | 38 // HtmlDialogUIDelegate implementation: |
| 38 virtual bool IsDialogModal() const OVERRIDE; | 39 virtual bool IsDialogModal() const OVERRIDE; |
| 39 virtual string16 GetDialogTitle() const OVERRIDE; | 40 virtual string16 GetDialogTitle() const OVERRIDE; |
| 40 virtual GURL GetDialogContentURL() const OVERRIDE; | 41 virtual GURL GetDialogContentURL() const OVERRIDE; |
| 41 virtual void GetWebUIMessageHandlers( | 42 virtual void GetWebUIMessageHandlers( |
| 42 std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE; | 43 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
| 43 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | 44 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
| 44 virtual std::string GetDialogArgs() const OVERRIDE; | 45 virtual std::string GetDialogArgs() const OVERRIDE; |
| 45 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | 46 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
| 46 virtual void OnCloseContents(content::WebContents* source, | 47 virtual void OnCloseContents(content::WebContents* source, |
| 47 bool* out_close_dialog) OVERRIDE {} | 48 bool* out_close_dialog) OVERRIDE {} |
| 48 virtual bool ShouldShowDialogTitle() const OVERRIDE; | 49 virtual bool ShouldShowDialogTitle() const OVERRIDE; |
| 49 | 50 |
| 50 // WebUIMessageHandler implementation: | 51 // WebUIMessageHandler implementation: |
| 51 virtual void RegisterMessages() OVERRIDE; | 52 virtual void RegisterMessages() OVERRIDE; |
| 52 | 53 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 83 scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; | 84 scoped_ptr<CookiesTreeModel> allowed_cookies_tree_model_; |
| 84 scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; | 85 scoped_ptr<CookiesTreeModel> blocked_cookies_tree_model_; |
| 85 | 86 |
| 86 CookiesTreeModelAdapter allowed_cookies_adapter_; | 87 CookiesTreeModelAdapter allowed_cookies_adapter_; |
| 87 CookiesTreeModelAdapter blocked_cookies_adapter_; | 88 CookiesTreeModelAdapter blocked_cookies_adapter_; |
| 88 | 89 |
| 89 DISALLOW_COPY_AND_ASSIGN(CollectedCookiesUIDelegate); | 90 DISALLOW_COPY_AND_ASSIGN(CollectedCookiesUIDelegate); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 #endif // CHROME_BROWSER_UI_WEBUI_COLLECTED_COOKIES_UI_DELEGATE_H_ | 93 #endif // CHROME_BROWSER_UI_WEBUI_COLLECTED_COOKIES_UI_DELEGATE_H_ |
| OLD | NEW |