Chromium Code Reviews| 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_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "chrome/common/content_settings.h" | 14 #include "chrome/common/content_settings.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
| 19 | 19 |
| 20 class Browser; | |
| 21 class Profile; | 20 class Profile; |
| 22 class TabContentsWrapper; | 21 class TabContentsWrapper; |
| 23 | 22 |
| 23 // Delegate which is used by ContentSettingBubbleModel. | |
| 24 class ContentSettingBubbleModelDelegate { | |
|
sky
2012/03/12 20:59:19
How come you didn't put this in a separate file li
altimofeev
2012/03/13 15:38:05
Done.
| |
| 25 public: | |
| 26 // Shows the cookies collected in the tab contents wrapper. | |
| 27 virtual void ShowCollectedCookiesDialog(TabContentsWrapper* contents) = 0; | |
| 28 | |
| 29 // Shows the Content Settings page for a given content type. | |
| 30 virtual void ShowContentSettingsPage(ContentSettingsType type) = 0; | |
| 31 | |
| 32 protected: | |
| 33 virtual ~ContentSettingBubbleModelDelegate() {} | |
| 34 }; | |
| 35 | |
| 24 // This model provides data for ContentSettingBubble, and also controls | 36 // This model provides data for ContentSettingBubble, and also controls |
| 25 // the action triggered when the allow / block radio buttons are triggered. | 37 // the action triggered when the allow / block radio buttons are triggered. |
| 26 class ContentSettingBubbleModel : public content::NotificationObserver { | 38 class ContentSettingBubbleModel : public content::NotificationObserver { |
| 27 public: | 39 public: |
| 28 virtual ~ContentSettingBubbleModel(); | 40 virtual ~ContentSettingBubbleModel(); |
| 29 | 41 |
| 42 typedef ContentSettingBubbleModelDelegate Delegate; | |
| 43 | |
| 30 static ContentSettingBubbleModel* CreateContentSettingBubbleModel( | 44 static ContentSettingBubbleModel* CreateContentSettingBubbleModel( |
| 31 Browser* browser, | 45 Delegate* delegate, |
| 32 TabContentsWrapper* tab_contents, | 46 TabContentsWrapper* tab_contents, |
| 33 Profile* profile, | 47 Profile* profile, |
| 34 ContentSettingsType content_type); | 48 ContentSettingsType content_type); |
| 35 | 49 |
| 36 ContentSettingsType content_type() const { return content_type_; } | 50 ContentSettingsType content_type() const { return content_type_; } |
| 37 | 51 |
| 38 struct PopupItem { | 52 struct PopupItem { |
| 39 SkBitmap bitmap; | 53 SkBitmap bitmap; |
| 40 std::string title; | 54 std::string title; |
| 41 TabContentsWrapper* tab_contents; | 55 TabContentsWrapper* tab_contents; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 Profile* profile_; | 141 Profile* profile_; |
| 128 ContentSettingsType content_type_; | 142 ContentSettingsType content_type_; |
| 129 BubbleContent bubble_content_; | 143 BubbleContent bubble_content_; |
| 130 // A registrar for listening for TAB_CONTENTS_DESTROYED notifications. | 144 // A registrar for listening for TAB_CONTENTS_DESTROYED notifications. |
| 131 content::NotificationRegistrar registrar_; | 145 content::NotificationRegistrar registrar_; |
| 132 | 146 |
| 133 DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); | 147 DISALLOW_COPY_AND_ASSIGN(ContentSettingBubbleModel); |
| 134 }; | 148 }; |
| 135 | 149 |
| 136 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 150 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
| OLD | NEW |