| 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 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/prerender/prerender_manager.h" | 9 #include "chrome/browser/prerender/prerender_manager.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
| 12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 13 #include "grit/theme_resources.h" | 13 #include "grit/theme_resources.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 | 15 |
| 16 using content::WebContents; | 16 using content::WebContents; |
| 17 | 17 |
| 18 class ContentSettingBlockedImageModel : public ContentSettingImageModel { | 18 class ContentSettingBlockedImageModel : public ContentSettingImageModel { |
| 19 public: | 19 public: |
| 20 explicit ContentSettingBlockedImageModel( | 20 explicit ContentSettingBlockedImageModel( |
| 21 ContentSettingsType content_settings_type); | 21 ContentSettingsType content_settings_type); |
| 22 | 22 |
| 23 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 23 virtual void UpdateFromWebContents(WebContents* web_contents) override; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 class ContentSettingGeolocationImageModel : public ContentSettingImageModel { | 26 class ContentSettingGeolocationImageModel : public ContentSettingImageModel { |
| 27 public: | 27 public: |
| 28 ContentSettingGeolocationImageModel(); | 28 ContentSettingGeolocationImageModel(); |
| 29 | 29 |
| 30 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 30 virtual void UpdateFromWebContents(WebContents* web_contents) override; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 // Image model for displaying media icons in the location bar. | 33 // Image model for displaying media icons in the location bar. |
| 34 class ContentSettingMediaImageModel : public ContentSettingImageModel { | 34 class ContentSettingMediaImageModel : public ContentSettingImageModel { |
| 35 public: | 35 public: |
| 36 explicit ContentSettingMediaImageModel(ContentSettingsType type); | 36 explicit ContentSettingMediaImageModel(ContentSettingsType type); |
| 37 | 37 |
| 38 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 38 virtual void UpdateFromWebContents(WebContents* web_contents) override; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 class ContentSettingRPHImageModel : public ContentSettingImageModel { | 41 class ContentSettingRPHImageModel : public ContentSettingImageModel { |
| 42 public: | 42 public: |
| 43 ContentSettingRPHImageModel(); | 43 ContentSettingRPHImageModel(); |
| 44 | 44 |
| 45 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 45 virtual void UpdateFromWebContents(WebContents* web_contents) override; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 class ContentSettingNotificationsImageModel : public ContentSettingImageModel { | 48 class ContentSettingNotificationsImageModel : public ContentSettingImageModel { |
| 49 public: | 49 public: |
| 50 ContentSettingNotificationsImageModel(); | 50 ContentSettingNotificationsImageModel(); |
| 51 | 51 |
| 52 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 52 virtual void UpdateFromWebContents(WebContents* web_contents) override; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class ContentSettingMIDISysExImageModel : public ContentSettingImageModel { | 55 class ContentSettingMIDISysExImageModel : public ContentSettingImageModel { |
| 56 public: | 56 public: |
| 57 ContentSettingMIDISysExImageModel(); | 57 ContentSettingMIDISysExImageModel(); |
| 58 | 58 |
| 59 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 59 virtual void UpdateFromWebContents(WebContents* web_contents) override; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| 63 | 63 |
| 64 struct ContentSettingsTypeIdEntry { | 64 struct ContentSettingsTypeIdEntry { |
| 65 ContentSettingsType type; | 65 ContentSettingsType type; |
| 66 int id; | 66 int id; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 int GetIdForContentType(const ContentSettingsTypeIdEntry* entries, | 69 int GetIdForContentType(const ContentSettingsTypeIdEntry* entries, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: | 358 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: |
| 359 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 359 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
| 360 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 360 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
| 361 return new ContentSettingMediaImageModel(content_settings_type); | 361 return new ContentSettingMediaImageModel(content_settings_type); |
| 362 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 362 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
| 363 return new ContentSettingMIDISysExImageModel(); | 363 return new ContentSettingMIDISysExImageModel(); |
| 364 default: | 364 default: |
| 365 return new ContentSettingBlockedImageModel(content_settings_type); | 365 return new ContentSettingBlockedImageModel(content_settings_type); |
| 366 } | 366 } |
| 367 } | 367 } |
| OLD | NEW |