chrome/browser/media/media_stream_capture_indicator.cc
// Gets the security originator of the tab. It returns a string with no '/'
// at the end to display in the UI.
Gets the security originator of the tab. It returns a string with no '/'
at the end to display in the UI.
Gets the security originator of the tab . It returns a string with no ' / ' at the end to display in the UI .
string16 GetSecurityOrigin(int render_process_id, int render_view_id) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  WebContents* tab_content = tab_util::GetWebContentsByID(
      render_process_id, render_view_id);
  if (!tab_content)
    return string16();
  std::string security_origin = tab_content->GetURL().GetOrigin().spec();
  if (!security_origin.empty()) {
    std::string::iterator it = security_origin.end() - 1;
    if (*it == '/')
      security_origin.erase(it);
  }
  return UTF8ToUTF16(security_origin);
}
string16 GetSecurityOrigin ( int render_process_id , int render_view_id ) { DCHECK ( BrowserThread :: CurrentlyOn ( BrowserThread :: UI ) ) ; WebContents * tab_content = tab_util :: GetWebContentsByID ( render_process_id , render_view_id ) ; if ( ! tab_content ) return string16 ( ) ; std :: string security_origin = tab_content -> GetURL ( ) . GetOrigin ( ) . spec ( ) ; if ( ! security_origin . empty ( ) ) { std :: string :: iterator it = security_origin . end ( ) - 1 ; if ( * it == ' ' ) security_origin . erase ( it ) ; } return UTF8ToUTF16 ( security_origin ) ; }
Gets the security originator of the tab.
Gets the security originator of the tab .
// Remove the last character if it is a '/'.