| 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 <set> |    8 #include <set> | 
|    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 "chrome/common/content_settings.h" |   13 #include "chrome/common/content_settings.h" | 
|   14 #include "chrome/common/custom_handlers/protocol_handler.h" |   14 #include "chrome/common/custom_handlers/protocol_handler.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 ContentSettingBubbleModelDelegate; |   20 class ContentSettingBubbleModelDelegate; | 
|   21 class Profile; |   21 class Profile; | 
 |   22 class ProtocolHandlerRegistry; | 
|   22 class TabContents; |   23 class TabContents; | 
|   23  |   24  | 
|   24 // This model provides data for ContentSettingBubble, and also controls |   25 // This model provides data for ContentSettingBubble, and also controls | 
|   25 // the action triggered when the allow / block radio buttons are triggered. |   26 // the action triggered when the allow / block radio buttons are triggered. | 
|   26 class ContentSettingBubbleModel : public content::NotificationObserver { |   27 class ContentSettingBubbleModel : public content::NotificationObserver { | 
|   27  public: |   28  public: | 
|   28   typedef ContentSettingBubbleModelDelegate Delegate; |   29   typedef ContentSettingBubbleModelDelegate Delegate; | 
|   29  |   30  | 
|   30   struct PopupItem { |   31   struct PopupItem { | 
|   31     SkBitmap bitmap; |   32     SkBitmap bitmap; | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  151   virtual void OnManageLinkClicked() OVERRIDE; |  152   virtual void OnManageLinkClicked() OVERRIDE; | 
|  152  |  153  | 
|  153   Delegate* delegate_; |  154   Delegate* delegate_; | 
|  154 }; |  155 }; | 
|  155  |  156  | 
|  156 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { |  157 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { | 
|  157  public: |  158  public: | 
|  158   ContentSettingRPHBubbleModel(Delegate* delegate, |  159   ContentSettingRPHBubbleModel(Delegate* delegate, | 
|  159                                TabContents* tab_contents, |  160                                TabContents* tab_contents, | 
|  160                                Profile* profile, |  161                                Profile* profile, | 
 |  162                                ProtocolHandlerRegistry* registry, | 
|  161                                ContentSettingsType content_type); |  163                                ContentSettingsType content_type); | 
|  162  |  164  | 
|  163   virtual void OnRadioClicked(int radio_index) OVERRIDE; |  165   virtual void OnRadioClicked(int radio_index) OVERRIDE; | 
|  164  |  166  | 
|  165  private: |  167  private: | 
|  166   // These states must match the order of appearance of the radio buttons |  168   // These states must match the order of appearance of the radio buttons | 
|  167   // in the XIB file for the Mac port. |  169   // in the XIB file for the Mac port. | 
|  168   enum RPHState { |  170   enum RPHState { | 
|  169     RPH_ALLOW = 0, |  171     RPH_ALLOW = 0, | 
|  170     RPH_BLOCK, |  172     RPH_BLOCK, | 
|  171     RPH_IGNORE, |  173     RPH_IGNORE, | 
|  172   }; |  174   }; | 
|  173  |  175  | 
|  174   void RegisterProtocolHandler(); |  176   void RegisterProtocolHandler(); | 
|  175   void UnregisterProtocolHandler(); |  177   void UnregisterProtocolHandler(); | 
|  176   void IgnoreProtocolHandler(); |  178   void IgnoreProtocolHandler(); | 
|  177   void ClearOrSetPreviousHandler(); |  179   void ClearOrSetPreviousHandler(); | 
|  178  |  180  | 
|  179   int selected_item_; |  181   int selected_item_; | 
 |  182   ProtocolHandlerRegistry* registry_; | 
|  180   ProtocolHandler pending_handler_; |  183   ProtocolHandler pending_handler_; | 
|  181   ProtocolHandler previous_handler_; |  184   ProtocolHandler previous_handler_; | 
|  182 }; |  185 }; | 
|  183  |  186  | 
|  184 #endif  // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |  187 #endif  // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 
| OLD | NEW |