| 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/views/extensions/media_galleries_dialog_views.h" | 5 #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/storage_monitor/media_storage_util.h" |
| 8 #include "chrome/browser/ui/views/constrained_window_views.h" | 9 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 10 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 10 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 11 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 11 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 12 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 12 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 14 #include "grit/locale_settings.h" | 15 #include "grit/locale_settings.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/native_theme/native_theme.h" | 18 #include "ui/native_theme/native_theme.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void MediaGalleriesDialogViews::UpdateGalleries() { | 193 void MediaGalleriesDialogViews::UpdateGalleries() { |
| 193 InitChildViews(); | 194 InitChildViews(); |
| 194 contents_->Layout(); | 195 contents_->Layout(); |
| 195 } | 196 } |
| 196 | 197 |
| 197 bool MediaGalleriesDialogViews::AddOrUpdateGallery( | 198 bool MediaGalleriesDialogViews::AddOrUpdateGallery( |
| 198 const MediaGalleryPrefInfo& gallery, | 199 const MediaGalleryPrefInfo& gallery, |
| 199 bool permitted, | 200 bool permitted, |
| 200 views::View* container, | 201 views::View* container, |
| 201 int trailing_vertical_space) { | 202 int trailing_vertical_space) { |
| 202 string16 label = gallery.GetGalleryDisplayName(); | 203 string16 label = MediaStorageUtil::GetGalleryDisplayNameFromPath( |
| 204 gallery.path); |
| 203 string16 tooltip_text = gallery.GetGalleryTooltip(); | 205 string16 tooltip_text = gallery.GetGalleryTooltip(); |
| 204 string16 details = gallery.GetGalleryAdditionalDetails(); | 206 string16 details = gallery.GetGalleryAdditionalDetails(); |
| 205 | 207 |
| 206 CheckboxMap::iterator iter = checkbox_map_.find(gallery.pref_id); | 208 CheckboxMap::iterator iter = checkbox_map_.find(gallery.pref_id); |
| 207 if (iter != checkbox_map_.end() && | 209 if (iter != checkbox_map_.end() && |
| 208 gallery.pref_id != kInvalidMediaGalleryPrefId) { | 210 gallery.pref_id != kInvalidMediaGalleryPrefId) { |
| 209 views::Checkbox* checkbox = iter->second; | 211 views::Checkbox* checkbox = iter->second; |
| 210 checkbox->SetChecked(permitted); | 212 checkbox->SetChecked(permitted); |
| 211 checkbox->SetText(label); | 213 checkbox->SetText(label); |
| 212 checkbox->SetElideBehavior(views::Label::ELIDE_IN_MIDDLE); | 214 checkbox->SetElideBehavior(views::Label::ELIDE_IN_MIDDLE); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 384 } |
| 383 } | 385 } |
| 384 | 386 |
| 385 // MediaGalleriesDialogViewsController ----------------------------------------- | 387 // MediaGalleriesDialogViewsController ----------------------------------------- |
| 386 | 388 |
| 387 // static | 389 // static |
| 388 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 390 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 389 MediaGalleriesDialogController* controller) { | 391 MediaGalleriesDialogController* controller) { |
| 390 return new MediaGalleriesDialogViews(controller); | 392 return new MediaGalleriesDialogViews(controller); |
| 391 } | 393 } |
| OLD | NEW |