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

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc

Issue 819133004: 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 5 years, 12 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
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/extensions/api/desktop_capture/desktop_capture_api.h" 5 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 error_ = kNoUrlError; 99 error_ = kNoUrlError;
100 return false; 100 return false;
101 } 101 }
102 origin_ = GURL(*(params->target_tab->url)).GetOrigin(); 102 origin_ = GURL(*(params->target_tab->url)).GetOrigin();
103 103
104 if (!origin_.is_valid()) { 104 if (!origin_.is_valid()) {
105 error_ = kInvalidOriginError; 105 error_ = kInvalidOriginError;
106 return false; 106 return false;
107 } 107 }
108 108
109 if (!CommandLine::ForCurrentProcess()->HasSwitch( 109 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
110 switches::kAllowHttpScreenCapture) && 110 switches::kAllowHttpScreenCapture) &&
111 !origin_.SchemeIsSecure()) { 111 !origin_.SchemeIsSecure()) {
112 error_ = kTabUrlNotSecure; 112 error_ = kTabUrlNotSecure;
113 return false; 113 return false;
114 } 114 }
115 target_name = base::UTF8ToUTF16(origin_.SchemeIsSecure() ? 115 target_name = base::UTF8ToUTF16(origin_.SchemeIsSecure() ?
116 net::GetHostAndOptionalPort(origin_) : origin_.spec()); 116 net::GetHostAndOptionalPort(origin_) : origin_.spec());
117 117
118 if (!params->target_tab->id) { 118 if (!params->target_tab->id) {
119 error_ = kNoTabIdError; 119 error_ = kNoTabIdError;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id, 298 void DesktopCaptureRequestsRegistry::CancelRequest(int process_id,
299 int request_id) { 299 int request_id) {
300 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id)); 300 RequestsMap::iterator it = requests_.find(RequestId(process_id, request_id));
301 if (it != requests_.end()) 301 if (it != requests_.end())
302 it->second->Cancel(); 302 it->second->Cancel();
303 } 303 }
304 304
305 305
306 } // namespace extensions 306 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698