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

Side by Side Diff: chrome/browser/ui/views/desktop_media_picker_views.h

Issue 502693003: Cleanup DesktopMediaPicker Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_
7 7
8 #include "chrome/browser/media/desktop_media_list_observer.h" 8 #include "chrome/browser/media/desktop_media_list_observer.h"
9 #include "chrome/browser/media/desktop_media_picker.h" 9 #include "chrome/browser/media/desktop_media_picker.h"
10 #include "ui/views/window/dialog_delegate.h" 10 #include "ui/views/window/dialog_delegate.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 bool selected_; 105 bool selected_;
106 106
107 DISALLOW_COPY_AND_ASSIGN(DesktopMediaSourceView); 107 DISALLOW_COPY_AND_ASSIGN(DesktopMediaSourceView);
108 }; 108 };
109 109
110 // Dialog view used for DesktopMediaPickerViews. 110 // Dialog view used for DesktopMediaPickerViews.
111 class DesktopMediaPickerDialogView : public views::DialogDelegateView { 111 class DesktopMediaPickerDialogView : public views::DialogDelegateView {
112 public: 112 public:
113 DesktopMediaPickerDialogView(content::WebContents* parent_web_contents, 113 DesktopMediaPickerDialogView(content::WebContents* parent_web_contents,
114 gfx::NativeWindow context,
115 gfx::NativeWindow parent_window,
116 DesktopMediaPickerViews* parent, 114 DesktopMediaPickerViews* parent,
117 const base::string16& app_name, 115 const base::string16& app_name,
118 const base::string16& target_name, 116 const base::string16& target_name,
119 scoped_ptr<DesktopMediaList> media_list); 117 scoped_ptr<DesktopMediaList> media_list);
120 virtual ~DesktopMediaPickerDialogView(); 118 virtual ~DesktopMediaPickerDialogView();
121 119
122 // Called by parent (DesktopMediaPickerViews) when it's destroyed. 120 // Called by parent (DesktopMediaPickerViews) when it's destroyed.
123 void DetachParent(); 121 void DetachParent();
124 122
125 // Called by DesktopMediaListView. 123 // Called by DesktopMediaListView.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Implementation of DesktopMediaPicker for Views. 155 // Implementation of DesktopMediaPicker for Views.
158 class DesktopMediaPickerViews : public DesktopMediaPicker { 156 class DesktopMediaPickerViews : public DesktopMediaPicker {
159 public: 157 public:
160 DesktopMediaPickerViews(); 158 DesktopMediaPickerViews();
161 virtual ~DesktopMediaPickerViews(); 159 virtual ~DesktopMediaPickerViews();
162 160
163 void NotifyDialogResult(content::DesktopMediaID source); 161 void NotifyDialogResult(content::DesktopMediaID source);
164 162
165 // DesktopMediaPicker overrides. 163 // DesktopMediaPicker overrides.
166 virtual void Show(content::WebContents* web_contents, 164 virtual void Show(content::WebContents* web_contents,
167 gfx::NativeWindow context,
168 gfx::NativeWindow parent,
169 const base::string16& app_name, 165 const base::string16& app_name,
170 const base::string16& target_name, 166 const base::string16& target_name,
171 scoped_ptr<DesktopMediaList> media_list, 167 scoped_ptr<DesktopMediaList> media_list,
172 const DoneCallback& done_callback) OVERRIDE; 168 const DoneCallback& done_callback) OVERRIDE;
173 169
174 DesktopMediaPickerDialogView* GetDialogViewForTesting() const { 170 DesktopMediaPickerDialogView* GetDialogViewForTesting() const {
175 return dialog_; 171 return dialog_;
176 } 172 }
177 173
178 private: 174 private:
179 DoneCallback callback_; 175 DoneCallback callback_;
180 176
181 // The |dialog_| is owned by the corresponding views::Widget instance. 177 // The |dialog_| is owned by the corresponding views::Widget instance.
182 // When DesktopMediaPickerViews is destroyed the |dialog_| is destroyed 178 // When DesktopMediaPickerViews is destroyed the |dialog_| is destroyed
183 // asynchronously by closing the widget. 179 // asynchronously by closing the widget.
184 DesktopMediaPickerDialogView* dialog_; 180 DesktopMediaPickerDialogView* dialog_;
185 181
186 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerViews); 182 DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerViews);
187 }; 183 };
188 184
189 #endif // CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_ 185 #endif // CHROME_BROWSER_UI_VIEWS_DESKTOP_MEDIA_PICKER_VIEWS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698