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

Unified Diff: chrome/browser/ui/views/desktop_media_picker_views_deprecated.cc

Issue 1962073002: Desktop Capture Picker New UI: Non Mac Structure Change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Unittest Crash Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/desktop_media_picker_views_deprecated.cc
diff --git a/chrome/browser/ui/views/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_media_picker_views_deprecated.cc
similarity index 95%
rename from chrome/browser/ui/views/desktop_media_picker_views.cc
rename to chrome/browser/ui/views/desktop_media_picker_views_deprecated.cc
index ac09e1bda50d1ca091553b4b28230364aa1aef3b..808c2d4e0b74867f468ef9fc9efbe40b51aa7c36 100644
--- a/chrome/browser/ui/views/desktop_media_picker_views.cc
+++ b/chrome/browser/ui/views/desktop_media_picker_views_deprecated.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/views/desktop_media_picker_views.h"
+#include "desktop_media_picker_views_deprecated.h"
#include <stddef.h>
#include <utility>
@@ -74,14 +74,15 @@ int GetMediaListViewHeightForRows(size_t rows) {
} // namespace
-DesktopMediaSourceView::DesktopMediaSourceView(
- DesktopMediaListView* parent,
- DesktopMediaID source_id)
+namespace deprecated {
+
+DesktopMediaSourceView::DesktopMediaSourceView(DesktopMediaListView* parent,
+ DesktopMediaID source_id)
: parent_(parent),
source_id_(source_id),
image_view_(new views::ImageView()),
label_(new views::Label()),
- selected_(false) {
+ selected_(false) {
AddChildView(image_view_);
AddChildView(label_);
SetFocusBehavior(FocusBehavior::ALWAYS);
@@ -132,8 +133,8 @@ const char* DesktopMediaSourceView::GetClassName() const {
}
void DesktopMediaSourceView::Layout() {
- image_view_->SetBounds(kThumbnailMargin, kThumbnailMargin,
- kThumbnailWidth, kThumbnailHeight);
+ image_view_->SetBounds(kThumbnailMargin, kThumbnailMargin, kThumbnailWidth,
+ kThumbnailHeight);
label_->SetBounds(kThumbnailMargin, kThumbnailHeight + kThumbnailMargin,
kThumbnailWidth, kLabelHeight);
}
@@ -462,8 +463,8 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView(
parent_web_contents &&
!parent_web_contents->GetDelegate()->IsNeverVisible(parent_web_contents);
if (modal_dialog) {
- widget = constrained_window::ShowWebModalDialogViews(this,
- parent_web_contents);
+ widget =
+ constrained_window::ShowWebModalDialogViews(this, parent_web_contents);
} else {
widget = DialogDelegate::CreateDialogWidget(this, context, NULL);
widget->Show();
@@ -509,7 +510,8 @@ ui::ModalType DesktopMediaPickerDialogView::GetModalType() const {
}
base::string16 DesktopMediaPickerDialogView::GetWindowTitle() const {
- return l10n_util::GetStringFUTF16(IDS_DESKTOP_MEDIA_PICKER_TITLE, app_name_);
+ return l10n_util::GetStringFUTF16(
+ IDS_DESKTOP_MEDIA_PICKER_TITLE_DEPRECATED, app_name_);
}
bool DesktopMediaPickerDialogView::IsDialogButtonEnabled(
@@ -525,8 +527,9 @@ views::View* DesktopMediaPickerDialogView::GetInitiallyFocusedView() {
base::string16 DesktopMediaPickerDialogView::GetDialogButtonLabel(
ui::DialogButton button) const {
- return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK ?
- IDS_DESKTOP_MEDIA_PICKER_SHARE : IDS_CANCEL);
+ return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK
+ ? IDS_DESKTOP_MEDIA_PICKER_SHARE
+ : IDS_CANCEL);
}
bool DesktopMediaPickerDialogView::Accept() {
@@ -623,8 +626,7 @@ DesktopMediaPickerDialogView::GetMediaSourceViewForTesting(int index) const {
sources_list_view_->child_at(index));
}
-DesktopMediaPickerViews::DesktopMediaPickerViews() : dialog_(NULL) {
-}
+DesktopMediaPickerViews::DesktopMediaPickerViews() : dialog_(NULL) {}
DesktopMediaPickerViews::~DesktopMediaPickerViews() {
if (dialog_) {
@@ -660,13 +662,9 @@ void DesktopMediaPickerViews::NotifyDialogResult(DesktopMediaID source) {
// Notify the |callback_| asynchronously because it may need to destroy
// DesktopMediaPicker.
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::Bind(callback_, source));
+ content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
+ base::Bind(callback_, source));
callback_.Reset();
}
-// static
-std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
- return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
-}
+} // namespace deprecated

Powered by Google App Engine
This is Rietveld 408576698