OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/desktop_capture/desktop_media_picker_views.h" | 5 #include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "chrome/browser/media/webrtc/desktop_media_list.h" | 8 #include "chrome/browser/media/webrtc/desktop_media_list.h" |
9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/public/browser/web_contents_delegate.h" | 22 #include "content/public/browser/web_contents_delegate.h" |
23 #include "ui/aura/window_tree_host.h" | 23 #include "ui/aura/window_tree_host.h" |
24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
25 #include "ui/events/keycodes/keyboard_codes.h" | 25 #include "ui/events/keycodes/keyboard_codes.h" |
26 #include "ui/gfx/canvas.h" | 26 #include "ui/gfx/canvas.h" |
27 #include "ui/views/background.h" | 27 #include "ui/views/background.h" |
28 #include "ui/views/controls/button/checkbox.h" | 28 #include "ui/views/controls/button/checkbox.h" |
29 #include "ui/views/controls/scroll_view.h" | 29 #include "ui/views/controls/scroll_view.h" |
30 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" | 30 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
31 #include "ui/views/layout/box_layout.h" | 31 #include "ui/views/layout/box_layout.h" |
32 #include "ui/views/layout/layout_constants.h" | |
33 #include "ui/views/widget/widget.h" | 32 #include "ui/views/widget/widget.h" |
34 #include "ui/views/window/dialog_client_view.h" | 33 #include "ui/views/window/dialog_client_view.h" |
35 #include "ui/wm/core/shadow_types.h" | 34 #include "ui/wm/core/shadow_types.h" |
36 | 35 |
37 using content::DesktopMediaID; | 36 using content::DesktopMediaID; |
38 | 37 |
39 namespace { | 38 namespace { |
40 | 39 |
41 #if !defined(USE_ASH) | 40 #if !defined(USE_ASH) |
42 DesktopMediaID::Id AcceleratedWidgetToDesktopMediaId( | 41 DesktopMediaID::Id AcceleratedWidgetToDesktopMediaId( |
(...skipping 15 matching lines...) Expand all Loading... |
58 const base::string16& app_name, | 57 const base::string16& app_name, |
59 const base::string16& target_name, | 58 const base::string16& target_name, |
60 std::unique_ptr<DesktopMediaList> screen_list, | 59 std::unique_ptr<DesktopMediaList> screen_list, |
61 std::unique_ptr<DesktopMediaList> window_list, | 60 std::unique_ptr<DesktopMediaList> window_list, |
62 std::unique_ptr<DesktopMediaList> tab_list, | 61 std::unique_ptr<DesktopMediaList> tab_list, |
63 bool request_audio) | 62 bool request_audio) |
64 : parent_(parent), | 63 : parent_(parent), |
65 description_label_(new views::Label()), | 64 description_label_(new views::Label()), |
66 audio_share_checkbox_(nullptr), | 65 audio_share_checkbox_(nullptr), |
67 pane_(new views::TabbedPane()) { | 66 pane_(new views::TabbedPane()) { |
| 67 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); |
| 68 |
68 SetLayoutManager(new views::BoxLayout( | 69 SetLayoutManager(new views::BoxLayout( |
69 views::BoxLayout::kVertical, views::kButtonHEdgeMarginNew, | 70 views::BoxLayout::kVertical, |
70 ChromeLayoutProvider::Get()->GetDistanceMetric( | 71 provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN), |
71 DISTANCE_PANEL_CONTENT_MARGIN), | 72 provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN), |
72 views::kLabelToControlVerticalSpacing)); | 73 provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL))); |
73 | 74 |
74 description_label_->SetMultiLine(true); | 75 description_label_->SetMultiLine(true); |
75 description_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 76 description_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
76 AddChildView(description_label_); | 77 AddChildView(description_label_); |
77 | 78 |
78 const SkColor bg_color = GetNativeTheme()->GetSystemColor( | 79 const SkColor bg_color = GetNativeTheme()->GetSystemColor( |
79 ui::NativeTheme::kColorId_DialogBackground); | 80 ui::NativeTheme::kColorId_DialogBackground); |
80 | 81 |
81 if (screen_list) { | 82 if (screen_list) { |
82 source_types_.push_back(DesktopMediaID::TYPE_SCREEN); | 83 source_types_.push_back(DesktopMediaID::TYPE_SCREEN); |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 // DesktopMediaPicker. | 450 // DesktopMediaPicker. |
450 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 451 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
451 base::BindOnce(callback_, source)); | 452 base::BindOnce(callback_, source)); |
452 callback_.Reset(); | 453 callback_.Reset(); |
453 } | 454 } |
454 | 455 |
455 // static | 456 // static |
456 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { | 457 std::unique_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { |
457 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); | 458 return std::unique_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); |
458 } | 459 } |
OLD | NEW |