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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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
OLDNEW
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_media_picker_views.h" 5 #include "chrome/browser/ui/views/desktop_media_picker_views.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/media/desktop_media_list.h" 10 #include "chrome/browser/media/desktop_media_list.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 source_view->SetName(source.name); 315 source_view->SetName(source.name);
316 source_view->SetGroup(kDesktopMediaSourceViewGroupId); 316 source_view->SetGroup(kDesktopMediaSourceViewGroupId);
317 AddChildViewAt(source_view, index); 317 AddChildViewAt(source_view, index);
318 318
319 PreferredSizeChanged(); 319 PreferredSizeChanged();
320 320
321 if (child_count() % kListColumns == 1) 321 if (child_count() % kListColumns == 1)
322 parent_->OnMediaListRowsChanged(); 322 parent_->OnMediaListRowsChanged();
323 323
324 std::string autoselect_source = 324 std::string autoselect_source =
325 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 325 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
326 switches::kAutoSelectDesktopCaptureSource); 326 switches::kAutoSelectDesktopCaptureSource);
327 if (!autoselect_source.empty() && 327 if (!autoselect_source.empty() &&
328 base::ASCIIToUTF16(autoselect_source) == source.name) { 328 base::ASCIIToUTF16(autoselect_source) == source.name) {
329 // Select, then accept and close the dialog when we're done adding sources. 329 // Select, then accept and close the dialog when we're done adding sources.
330 source_view->OnFocus(); 330 source_view->OnFocus();
331 content::BrowserThread::PostTask( 331 content::BrowserThread::PostTask(
332 content::BrowserThread::UI, FROM_HERE, 332 content::BrowserThread::UI, FROM_HERE,
333 base::Bind(&DesktopMediaListView::AcceptSelection, 333 base::Bind(&DesktopMediaListView::AcceptSelection,
334 weak_factory_.GetWeakPtr())); 334 weak_factory_.GetWeakPtr()));
335 } 335 }
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 content::BrowserThread::PostTask( 593 content::BrowserThread::PostTask(
594 content::BrowserThread::UI, FROM_HERE, 594 content::BrowserThread::UI, FROM_HERE,
595 base::Bind(callback_, source)); 595 base::Bind(callback_, source));
596 callback_.Reset(); 596 callback_.Reset();
597 } 597 }
598 598
599 // static 599 // static
600 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() { 600 scoped_ptr<DesktopMediaPicker> DesktopMediaPicker::Create() {
601 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews()); 601 return scoped_ptr<DesktopMediaPicker>(new DesktopMediaPickerViews());
602 } 602 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698