| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 callback_.Run(ui::DIALOG_BUTTON_OK); | 79 callback_.Run(ui::DIALOG_BUTTON_OK); |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 gfx::Size RequestFileSystemDialogView::GetPreferredSize() const { | 83 gfx::Size RequestFileSystemDialogView::GetPreferredSize() const { |
| 84 return gfx::Size(kDialogMaxWidth, | 84 return gfx::Size(kDialogMaxWidth, |
| 85 child_at(0)->GetHeightForWidth(kDialogMaxWidth)); | 85 child_at(0)->GetHeightForWidth(kDialogMaxWidth)); |
| 86 } | 86 } |
| 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( |
| 90 views::INSETS_DIALOG_CONTENTS); |
| 90 } | 91 } |
| 91 | 92 |
| 92 RequestFileSystemDialogView::RequestFileSystemDialogView( | 93 RequestFileSystemDialogView::RequestFileSystemDialogView( |
| 93 const std::string& extension_name, | 94 const std::string& extension_name, |
| 94 const std::string& volume_label, | 95 const std::string& volume_label, |
| 95 bool writable, | 96 bool writable, |
| 96 const base::Callback<void(ui::DialogButton)>& callback) | 97 const base::Callback<void(ui::DialogButton)>& callback) |
| 97 : callback_(callback) { | 98 : callback_(callback) { |
| 98 DCHECK(!callback_.is_null()); | 99 DCHECK(!callback_.is_null()); |
| 99 | 100 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 118 bold_style); | 119 bold_style); |
| 119 label->AddStyleRange( | 120 label->AddStyleRange( |
| 120 gfx::Range(placeholder_offsets[1], | 121 gfx::Range(placeholder_offsets[1], |
| 121 placeholder_offsets[1] + volume_name.length()), | 122 placeholder_offsets[1] + volume_name.length()), |
| 122 bold_style); | 123 bold_style); |
| 123 | 124 |
| 124 SetLayoutManager(new views::FillLayout()); | 125 SetLayoutManager(new views::FillLayout()); |
| 125 | 126 |
| 126 AddChildView(label); | 127 AddChildView(label); |
| 127 } | 128 } |
| OLD | NEW |