1// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5// The LoadNotificationDetails object contains additional details about a 6// page load that has been completed. It was created to let the MetricsService 7// log page load metrics. 8 9#ifndef CHROME_BROWSER_LOAD_NOTIFICATION_DETAILS_H__ 10#define CHROME_BROWSER_LOAD_NOTIFICATION_DETAILS_H__ 11#pragma once 12 13#include "base/basictypes.h" 14#include "base/time.h" 15#include "content/browser/tab_contents/navigation_controller.h" 16#include "content/common/page_transition_types.h" 17#include "googleurl/src/gurl.h" 18 19class LoadNotificationDetails { 20 public: 21 LoadNotificationDetails(const GURL& url, 22 PageTransition::Type origin, 23 base::TimeDelta load_time, 24 NavigationController* controller, 25 int session_index) 26 : url_(url), 27 load_time_(load_time), 28 session_index_(session_index), 29 origin_(origin), 30 controller_(controller) {} 31 32 ~LoadNotificationDetails() {} 33 34 const GURL& url() const { return url_; } 35 PageTransition::Type origin() const { return origin_; } 36 base::TimeDelta load_time() const { return load_time_; } 37 int session_index() const { return session_index_; } 38 NavigationController* controller() const { return controller_; } 39 40 private: 41 GURL url_; // the URL loaded 42 base::TimeDelta load_time_; // length of time the page load took 43 int session_index_; // index of the load within the tab session 44 PageTransition::Type origin_; // type of action that caused the load 45 NavigationController* controller_; // tells us which tab the load was in 46 47 LoadNotificationDetails() {} 48 49 DISALLOW_COPY_AND_ASSIGN(LoadNotificationDetails); 50}; 51 52#endif // CHROME_BROWSER_LOAD_NOTIFICATION_DETAILS_H__ 53