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/extensions/api/file_system/request_file_system_dialog_v
iew.h" | 5 #include "chrome/browser/extensions/api/file_system/request_file_system_dialog_v
iew.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cstdlib> | 9 #include <cstdlib> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 base::UTF8ToUTF16(!volume->volume_label().empty() ? volume->volume_label() | 114 base::UTF8ToUTF16(!volume->volume_label().empty() ? volume->volume_label() |
115 : volume->volume_id()); | 115 : volume->volume_id()); |
116 std::vector<size_t> placeholder_offsets; | 116 std::vector<size_t> placeholder_offsets; |
117 const base::string16 message = l10n_util::GetStringFUTF16( | 117 const base::string16 message = l10n_util::GetStringFUTF16( |
118 writable ? IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_WRITABLE_MESSAGE | 118 writable ? IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_WRITABLE_MESSAGE |
119 : IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_MESSAGE, | 119 : IDS_FILE_SYSTEM_REQUEST_FILE_SYSTEM_DIALOG_MESSAGE, |
120 app_name, volume_name, &placeholder_offsets); | 120 app_name, volume_name, &placeholder_offsets); |
121 | 121 |
122 views::StyledLabel* const label = new views::StyledLabel(message, nullptr); | 122 views::StyledLabel* const label = new views::StyledLabel(message, nullptr); |
123 views::StyledLabel::RangeStyleInfo bold_style; | 123 views::StyledLabel::RangeStyleInfo bold_style; |
124 bold_style.font_style = gfx::Font::BOLD; | 124 bold_style.weight = gfx::Font::Weight::BOLD; |
125 | 125 |
126 DCHECK_EQ(2u, placeholder_offsets.size()); | 126 DCHECK_EQ(2u, placeholder_offsets.size()); |
127 label->AddStyleRange(gfx::Range(placeholder_offsets[0], | 127 label->AddStyleRange(gfx::Range(placeholder_offsets[0], |
128 placeholder_offsets[0] + app_name.length()), | 128 placeholder_offsets[0] + app_name.length()), |
129 bold_style); | 129 bold_style); |
130 label->AddStyleRange( | 130 label->AddStyleRange( |
131 gfx::Range(placeholder_offsets[1], | 131 gfx::Range(placeholder_offsets[1], |
132 placeholder_offsets[1] + volume_name.length()), | 132 placeholder_offsets[1] + volume_name.length()), |
133 bold_style); | 133 bold_style); |
134 | 134 |
135 views::BoxLayout* const layout = new views::BoxLayout( | 135 views::BoxLayout* const layout = new views::BoxLayout( |
136 views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew, | 136 views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew, |
137 views::kPanelVertMargin, 0); | 137 views::kPanelVertMargin, 0); |
138 contents_view_->SetLayoutManager(layout); | 138 contents_view_->SetLayoutManager(layout); |
139 | 139 |
140 label->SizeToFit(kDialogMaxWidth - 2 * views::kButtonHEdgeMarginNew); | 140 label->SizeToFit(kDialogMaxWidth - 2 * views::kButtonHEdgeMarginNew); |
141 contents_view_->AddChildView(label); | 141 contents_view_->AddChildView(label); |
142 } | 142 } |
OLD | NEW |