OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/request_file_system_dialog_view.h" | 5 #include "chrome/browser/ui/views/extensions/request_file_system_dialog_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 gfx::Insets RequestFileSystemDialogView::GetInsets() const { | 88 gfx::Insets RequestFileSystemDialogView::GetInsets() const { |
89 return ChromeLayoutProvider::Get()->GetInsetsMetric(views::INSETS_PANEL); | 89 return ChromeLayoutProvider::Get()->GetInsetsMetric(views::INSETS_PANEL); |
90 } | 90 } |
91 | 91 |
92 RequestFileSystemDialogView::RequestFileSystemDialogView( | 92 RequestFileSystemDialogView::RequestFileSystemDialogView( |
93 const std::string& extension_name, | 93 const std::string& extension_name, |
94 const std::string& volume_label, | 94 const std::string& volume_label, |
95 bool writable, | 95 bool writable, |
96 const base::Callback<void(ui::DialogButton)>& callback) | 96 const base::Callback<void(ui::DialogButton)>& callback) |
97 : callback_(callback), contents_view_(new views::View) { | 97 : callback_(callback) { |
98 DCHECK(!callback_.is_null()); | 98 DCHECK(!callback_.is_null()); |
99 | 99 |
100 const base::string16 app_name = base::UTF8ToUTF16(extension_name); | 100 const base::string16 app_name = base::UTF8ToUTF16(extension_name); |
101 // TODO(mtomasz): Improve the dialog contents, so it's easier for the user | 101 // TODO(mtomasz): Improve the dialog contents, so it's easier for the user |
102 // to understand what device is being requested. | 102 // to understand what device is being requested. |
103 const base::string16 volume_name = base::UTF8ToUTF16(volume_label); | 103 const base::string16 volume_name = base::UTF8ToUTF16(volume_label); |
104 | 104 |
105 std::vector<size_t> placeholder_offsets; | 105 std::vector<size_t> placeholder_offsets; |
106 const base::string16 message = l10n_util::GetStringFUTF16( | 106 const base::string16 message = l10n_util::GetStringFUTF16( |
107 writable ? IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_WRITABLE_MESSAGE | 107 writable ? IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_WRITABLE_MESSAGE |
(...skipping 10 matching lines...) Expand all Loading... |
118 bold_style); | 118 bold_style); |
119 label->AddStyleRange( | 119 label->AddStyleRange( |
120 gfx::Range(placeholder_offsets[1], | 120 gfx::Range(placeholder_offsets[1], |
121 placeholder_offsets[1] + volume_name.length()), | 121 placeholder_offsets[1] + volume_name.length()), |
122 bold_style); | 122 bold_style); |
123 | 123 |
124 SetLayoutManager(new views::FillLayout()); | 124 SetLayoutManager(new views::FillLayout()); |
125 | 125 |
126 AddChildView(label); | 126 AddChildView(label); |
127 } | 127 } |
OLD | NEW |