OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/google/chrome_google_url_tracker_client.h" | 5 #include "chrome/browser/google/chrome_google_url_tracker_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/google/google_url_tracker_navigation_helper_impl.h" | 9 #include "chrome/browser/google/google_url_tracker_navigation_helper_impl.h" |
10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return profile_->GetRequestContext(); | 59 return profile_->GetRequestContext(); |
60 } | 60 } |
61 | 61 |
62 bool ChromeGoogleURLTrackerClient::IsGoogleDomainURL(const GURL& url) { | 62 bool ChromeGoogleURLTrackerClient::IsGoogleDomainURL(const GURL& url) { |
63 return google_util::IsGoogleDomainUrl( | 63 return google_util::IsGoogleDomainUrl( |
64 url, | 64 url, |
65 google_util::DISALLOW_SUBDOMAIN, | 65 google_util::DISALLOW_SUBDOMAIN, |
66 google_util::DISALLOW_NON_STANDARD_PORTS); | 66 google_util::DISALLOW_NON_STANDARD_PORTS); |
67 } | 67 } |
68 | 68 |
69 GURL ChromeGoogleURLTrackerClient::AppendGoogleLocaleParam(const GURL& url) { | |
70 return google_util::AppendGoogleLocaleParam(url); | |
71 } | |
72 | |
73 void ChromeGoogleURLTrackerClient::Observe( | 69 void ChromeGoogleURLTrackerClient::Observe( |
74 int type, | 70 int type, |
75 const content::NotificationSource& source, | 71 const content::NotificationSource& source, |
76 const content::NotificationDetails& details) { | 72 const content::NotificationDetails& details) { |
77 DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_PENDING, type); | 73 DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_PENDING, type); |
78 content::NavigationController* controller = | 74 content::NavigationController* controller = |
79 content::Source<content::NavigationController>(source).ptr(); | 75 content::Source<content::NavigationController>(source).ptr(); |
80 InfoBarService* infobar_service = | 76 InfoBarService* infobar_service = |
81 InfoBarService::FromWebContents(controller->GetWebContents()); | 77 InfoBarService::FromWebContents(controller->GetWebContents()); |
82 // Because we're listening to all sources, there may be no InfoBarService for | 78 // Because we're listening to all sources, there may be no InfoBarService for |
83 // some notifications, e.g. navigations in bubbles/balloons etc. | 79 // some notifications, e.g. navigations in bubbles/balloons etc. |
84 if (infobar_service) { | 80 if (infobar_service) { |
85 google_url_tracker()->OnNavigationPending( | 81 google_url_tracker()->OnNavigationPending( |
86 scoped_ptr<GoogleURLTrackerNavigationHelper>( | 82 scoped_ptr<GoogleURLTrackerNavigationHelper>( |
87 new GoogleURLTrackerNavigationHelperImpl( | 83 new GoogleURLTrackerNavigationHelperImpl( |
88 controller->GetWebContents(), google_url_tracker())), | 84 controller->GetWebContents(), google_url_tracker())), |
89 infobar_service, | 85 infobar_service, |
90 controller->GetPendingEntry()->GetUniqueID()); | 86 controller->GetPendingEntry()->GetUniqueID()); |
91 } | 87 } |
92 } | 88 } |
OLD | NEW |