Chromium Code Reviews| 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" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 class ContentSettingSavePasswordImageModel : public ContentSettingImageModel { | 62 class ContentSettingSavePasswordImageModel : public ContentSettingImageModel { |
| 63 public: | 63 public: |
| 64 ContentSettingSavePasswordImageModel(); | 64 ContentSettingSavePasswordImageModel(); |
| 65 | 65 |
| 66 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; | 66 virtual void UpdateFromWebContents(WebContents* web_contents) OVERRIDE; |
| 67 virtual bool ShouldShowBubbleOnBlockage(); | |
|
Peter Kasting
2013/09/04 20:59:11
OVERRIDE
npentrel
2013/09/04 21:50:18
Done.
| |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 namespace { | 70 namespace { |
| 70 | 71 |
| 71 struct ContentSettingsTypeIdEntry { | 72 struct ContentSettingsTypeIdEntry { |
| 72 ContentSettingsType type; | 73 ContentSettingsType type; |
| 73 int id; | 74 int id; |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 int GetIdForContentType(const ContentSettingsTypeIdEntry* entries, | 77 int GetIdForContentType(const ContentSettingsTypeIdEntry* entries, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 set_icon(IDR_SAVE_PASSWORD); | 227 set_icon(IDR_SAVE_PASSWORD); |
| 227 set_visible(true); | 228 set_visible(true); |
| 228 break; | 229 break; |
| 229 case TabSpecificContentSettings::NO_PASSWORD_TO_BE_SAVED: | 230 case TabSpecificContentSettings::NO_PASSWORD_TO_BE_SAVED: |
| 230 set_icon(IDR_SAVE_PASSWORD); | 231 set_icon(IDR_SAVE_PASSWORD); |
| 231 set_visible(false); | 232 set_visible(false); |
| 232 break; | 233 break; |
| 233 } | 234 } |
| 234 } | 235 } |
| 235 | 236 |
| 237 bool ContentSettingSavePasswordImageModel::ShouldShowBubbleOnBlockage() { | |
| 238 return true; | |
| 239 } | |
| 240 | |
| 236 ContentSettingMediaImageModel::ContentSettingMediaImageModel( | 241 ContentSettingMediaImageModel::ContentSettingMediaImageModel( |
| 237 ContentSettingsType type) | 242 ContentSettingsType type) |
| 238 : ContentSettingImageModel(type) { | 243 : ContentSettingImageModel(type) { |
| 239 } | 244 } |
| 240 | 245 |
| 241 void ContentSettingMediaImageModel::UpdateFromWebContents( | 246 void ContentSettingMediaImageModel::UpdateFromWebContents( |
| 242 WebContents* web_contents) { | 247 WebContents* web_contents) { |
| 243 set_visible(false); | 248 set_visible(false); |
| 244 | 249 |
| 245 // As long as a single icon is used to display the status of the camera and | 250 // As long as a single icon is used to display the status of the camera and |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 } | 375 } |
| 371 | 376 |
| 372 ContentSettingImageModel::ContentSettingImageModel( | 377 ContentSettingImageModel::ContentSettingImageModel( |
| 373 ContentSettingsType content_settings_type) | 378 ContentSettingsType content_settings_type) |
| 374 : content_settings_type_(content_settings_type), | 379 : content_settings_type_(content_settings_type), |
| 375 is_visible_(false), | 380 is_visible_(false), |
| 376 icon_(0), | 381 icon_(0), |
| 377 explanatory_string_id_(0) { | 382 explanatory_string_id_(0) { |
| 378 } | 383 } |
| 379 | 384 |
| 385 bool ContentSettingImageModel::ShouldShowBubbleOnBlockage() { | |
| 386 return false; | |
| 387 } | |
| 388 | |
| 380 // static | 389 // static |
| 381 ContentSettingImageModel* | 390 ContentSettingImageModel* |
| 382 ContentSettingImageModel::CreateContentSettingImageModel( | 391 ContentSettingImageModel::CreateContentSettingImageModel( |
| 383 ContentSettingsType content_settings_type) { | 392 ContentSettingsType content_settings_type) { |
| 384 switch (content_settings_type) { | 393 switch (content_settings_type) { |
| 385 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 394 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| 386 return new ContentSettingGeolocationImageModel(); | 395 return new ContentSettingGeolocationImageModel(); |
| 387 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 396 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 388 return new ContentSettingNotificationsImageModel(); | 397 return new ContentSettingNotificationsImageModel(); |
| 389 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS: | 398 case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS: |
| 390 return new ContentSettingRPHImageModel(); | 399 return new ContentSettingRPHImageModel(); |
| 391 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: | 400 case CONTENT_SETTINGS_TYPE_MEDIASTREAM: |
| 392 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: | 401 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
| 393 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: | 402 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
| 394 return new ContentSettingMediaImageModel(content_settings_type); | 403 return new ContentSettingMediaImageModel(content_settings_type); |
| 395 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 404 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
| 396 return new ContentSettingMIDISysExImageModel(); | 405 return new ContentSettingMIDISysExImageModel(); |
| 397 case CONTENT_SETTINGS_TYPE_SAVE_PASSWORD: | 406 case CONTENT_SETTINGS_TYPE_SAVE_PASSWORD: |
| 398 return new ContentSettingSavePasswordImageModel(); | 407 return new ContentSettingSavePasswordImageModel(); |
| 399 default: | 408 default: |
| 400 return new ContentSettingBlockedImageModel(content_settings_type); | 409 return new ContentSettingBlockedImageModel(content_settings_type); |
| 401 } | 410 } |
| 402 } | 411 } |
| OLD | NEW |