| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 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/browser/content_settings/tab_specific_content_settings.h" |
| 14 #include "chrome/common/content_settings.h" | 15 #include "chrome/common/content_settings.h" |
| 15 #include "chrome/common/custom_handlers/protocol_handler.h" | 16 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/common/media_stream_request.h" | 19 #include "content/public/common/media_stream_request.h" |
| 19 #include "ui/gfx/image/image.h" | 20 #include "ui/gfx/image/image.h" |
| 20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
| 21 | 22 |
| 22 class ContentSettingBubbleModelDelegate; | 23 class ContentSettingBubbleModelDelegate; |
| 23 class Profile; | 24 class Profile; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const content::NotificationSource& source, | 106 const content::NotificationSource& source, |
| 106 const content::NotificationDetails& details) OVERRIDE; | 107 const content::NotificationDetails& details) OVERRIDE; |
| 107 | 108 |
| 108 virtual void OnRadioClicked(int radio_index) {} | 109 virtual void OnRadioClicked(int radio_index) {} |
| 109 virtual void OnPopupClicked(int index) {} | 110 virtual void OnPopupClicked(int index) {} |
| 110 virtual void OnCustomLinkClicked() {} | 111 virtual void OnCustomLinkClicked() {} |
| 111 virtual void OnManageLinkClicked() {} | 112 virtual void OnManageLinkClicked() {} |
| 112 virtual void OnMediaMenuClicked(content::MediaStreamType type, | 113 virtual void OnMediaMenuClicked(content::MediaStreamType type, |
| 113 const std::string& selected_device_id) {} | 114 const std::string& selected_device_id) {} |
| 114 | 115 |
| 116 // Called by the view code when the cancel button in clicked by the user. |
| 117 virtual void OnCancelClicked() {} |
| 118 |
| 115 // Called by the view code when the bubble is closed by the user using the | 119 // Called by the view code when the bubble is closed by the user using the |
| 116 // Done button. | 120 // Done button. |
| 117 virtual void OnDoneClicked() {} | 121 virtual void OnDoneClicked() {} |
| 118 | 122 |
| 123 // Called by the view code when the save button in clicked by the user. |
| 124 virtual void OnSaveClicked() {} |
| 125 |
| 119 protected: | 126 protected: |
| 120 ContentSettingBubbleModel( | 127 ContentSettingBubbleModel( |
| 121 content::WebContents* web_contents, | 128 content::WebContents* web_contents, |
| 122 Profile* profile, | 129 Profile* profile, |
| 123 ContentSettingsType content_type); | 130 ContentSettingsType content_type); |
| 124 | 131 |
| 125 content::WebContents* web_contents() const { return web_contents_; } | 132 content::WebContents* web_contents() const { return web_contents_; } |
| 126 Profile* profile() const { return profile_; } | 133 Profile* profile() const { return profile_; } |
| 127 | 134 |
| 128 void set_title(const std::string& title) { bubble_content_.title = title; } | 135 void set_title(const std::string& title) { bubble_content_.title = title; } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 184 |
| 178 private: | 185 private: |
| 179 void SetBlockedResources(); | 186 void SetBlockedResources(); |
| 180 void SetTitle(); | 187 void SetTitle(); |
| 181 void SetManageLink(); | 188 void SetManageLink(); |
| 182 virtual void OnManageLinkClicked() OVERRIDE; | 189 virtual void OnManageLinkClicked() OVERRIDE; |
| 183 | 190 |
| 184 Delegate* delegate_; | 191 Delegate* delegate_; |
| 185 }; | 192 }; |
| 186 | 193 |
| 194 class SavePasswordBubbleModel : public ContentSettingTitleAndLinkModel { |
| 195 public: |
| 196 SavePasswordBubbleModel(Delegate* delegate, |
| 197 content::WebContents* web_contents, |
| 198 Profile* profile); |
| 199 virtual ~SavePasswordBubbleModel() {} |
| 200 virtual void OnCancelClicked() OVERRIDE; |
| 201 virtual void OnSaveClicked() OVERRIDE; |
| 202 |
| 203 private: |
| 204 // Sets the title of the bubble. |
| 205 void SetTitle(); |
| 206 |
| 207 TabSpecificContentSettings::PasswordSavingState state_; |
| 208 |
| 209 DISALLOW_COPY_AND_ASSIGN(SavePasswordBubbleModel); |
| 210 }; |
| 211 |
| 187 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { | 212 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { |
| 188 public: | 213 public: |
| 189 ContentSettingRPHBubbleModel(Delegate* delegate, | 214 ContentSettingRPHBubbleModel(Delegate* delegate, |
| 190 content::WebContents* web_contents, | 215 content::WebContents* web_contents, |
| 191 Profile* profile, | 216 Profile* profile, |
| 192 ProtocolHandlerRegistry* registry, | 217 ProtocolHandlerRegistry* registry, |
| 193 ContentSettingsType content_type); | 218 ContentSettingsType content_type); |
| 194 | 219 |
| 195 virtual void OnRadioClicked(int radio_index) OVERRIDE; | 220 virtual void OnRadioClicked(int radio_index) OVERRIDE; |
| 196 virtual void OnDoneClicked() OVERRIDE; | 221 virtual void OnDoneClicked() OVERRIDE; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 209 void IgnoreProtocolHandler(); | 234 void IgnoreProtocolHandler(); |
| 210 void ClearOrSetPreviousHandler(); | 235 void ClearOrSetPreviousHandler(); |
| 211 | 236 |
| 212 int selected_item_; | 237 int selected_item_; |
| 213 ProtocolHandlerRegistry* registry_; | 238 ProtocolHandlerRegistry* registry_; |
| 214 ProtocolHandler pending_handler_; | 239 ProtocolHandler pending_handler_; |
| 215 ProtocolHandler previous_handler_; | 240 ProtocolHandler previous_handler_; |
| 216 }; | 241 }; |
| 217 | 242 |
| 218 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 243 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
| OLD | NEW |