Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: chrome/browser/media_galleries/media_galleries_dialog_controller.cc

Issue 12544005: Consolidate storage_monitor/MediaDeviceNotificationsUtils into MediaStorageUtil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac apply patch Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/storage_monitor/disk_info_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/media_galleries/media_galleries_dialog_controller.h" 5 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/media_galleries/media_file_system_registry.h" 12 #include "chrome/browser/media_galleries/media_file_system_registry.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/storage_monitor/media_device_notifications_utils.h"
15 #include "chrome/browser/storage_monitor/media_storage_util.h" 14 #include "chrome/browser/storage_monitor/media_storage_util.h"
16 #include "chrome/browser/storage_monitor/storage_info.h" 15 #include "chrome/browser/storage_monitor/storage_info.h"
17 #include "chrome/browser/ui/chrome_select_file_policy.h" 16 #include "chrome/browser/ui/chrome_select_file_policy.h"
18 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.h"
19 #include "chrome/common/extensions/extension.h" 18 #include "chrome/common/extensions/extension.h"
20 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
21 #include "content/public/browser/web_contents_view.h" 20 #include "content/public/browser/web_contents_view.h"
22 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
23 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
24 23
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 monitor->RemoveObserver(this); 75 monitor->RemoveObserver(this);
77 76
78 if (select_folder_dialog_.get()) 77 if (select_folder_dialog_.get())
79 select_folder_dialog_->ListenerDestroyed(); 78 select_folder_dialog_->ListenerDestroyed();
80 } 79 }
81 80
82 string16 ConstructGalleryNameFromMetadata( 81 string16 ConstructGalleryNameFromMetadata(
83 const string16& vendor_name, 82 const string16& vendor_name,
84 const string16& model_name, 83 const string16& model_name,
85 uint64 size_in_bytes) { 84 uint64 size_in_bytes) {
86 return chrome::GetDisplayNameForDevice( 85 return MediaStorageUtil::GetDisplayNameForDevice(
87 size_in_bytes, 86 size_in_bytes,
88 chrome::GetFullProductName(UTF16ToUTF8(vendor_name), 87 MediaStorageUtil::GetFullProductName(UTF16ToUTF8(vendor_name),
89 UTF16ToUTF8(model_name))); 88 UTF16ToUTF8(model_name)));
90 89
91 } 90 }
92 91
93 // static 92 // static
94 string16 MediaGalleriesDialogController::GetGalleryDisplayName( 93 string16 MediaGalleriesDialogController::GetGalleryDisplayName(
95 const MediaGalleryPrefInfo& gallery) { 94 const MediaGalleryPrefInfo& gallery) {
96 string16 name = gallery.display_name; 95 string16 name = gallery.display_name;
97 if (IsAttachedDevice(gallery.device_id)) { 96 if (IsAttachedDevice(gallery.device_id)) {
98 name += ASCIIToUTF16(" "); 97 name += ASCIIToUTF16(" ");
99 name += 98 name +=
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 if (iter->pref_info.device_id == device_id) 407 if (iter->pref_info.device_id == device_id)
409 dialog_->UpdateGallery(&iter->pref_info, iter->allowed); 408 dialog_->UpdateGallery(&iter->pref_info, iter->allowed);
410 } 409 }
411 } 410 }
412 411
413 // MediaGalleries dialog ------------------------------------------------------- 412 // MediaGalleries dialog -------------------------------------------------------
414 413
415 MediaGalleriesDialog::~MediaGalleriesDialog() {} 414 MediaGalleriesDialog::~MediaGalleriesDialog() {}
416 415
417 } // namespace chrome 416 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/storage_monitor/disk_info_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698