Home | History | Annotate | Download | only in browser
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.browser;
     18 
     19 import android.util.EventLog;
     20 
     21 public class LogTag {
     22 
     23     /**
     24      * Log when the user is adding a new bookmark.
     25      *
     26      * @param url the url of the new bookmark.
     27      * @param where the location from where the bookmark was added
     28      */
     29     public static void logBookmarkAdded(String url, String where) {
     30         EventLog.writeEvent(EventLogTags.BROWSER_BOOKMARK_ADDED, url + "|"
     31             + where);
     32     }
     33 
     34     /**
     35      * Log when a page has finished loading with how much
     36      * time the browser used to load the page.
     37      *
     38      * Note that a redirect will restart the timer, so this time is not
     39      * always how long it takes for the user to load a page.
     40      *
     41      * @param url the url of that page that finished loading.
     42      * @param duration the time the browser spent loading the page.
     43      */
     44     public static void logPageFinishedLoading(String url, long duration) {
     45         EventLog.writeEvent(EventLogTags.BROWSER_PAGE_LOADED, url + "|"
     46             + duration);
     47     }
     48 
     49     /**
     50      * log the time the user has spent on a webpage
     51      *
     52      * @param url the url of the page that is being logged (old page).
     53      * @param duration the time spent on the webpage.
     54      */
     55     public static void logTimeOnPage(String url, long duration) {
     56         EventLog.writeEvent(EventLogTags.BROWSER_TIMEONPAGE, url + "|"
     57             + duration);
     58     }
     59 }
     60