| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/google_url_tracker_navigation_helper_impl.h" | 5 #include "chrome/browser/google/google_url_tracker_navigation_helper_impl.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "components/google/core/browser/google_url_tracker.h" | 9 #include "components/google/core/browser/google_url_tracker.h" |
| 10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return registrar_.IsRegistered( | 65 return registrar_.IsRegistered( |
| 66 this, | 66 this, |
| 67 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 67 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 68 content::Source<content::WebContents>(web_contents_)); | 68 content::Source<content::WebContents>(web_contents_)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void GoogleURLTrackerNavigationHelperImpl::OpenURL( | 71 void GoogleURLTrackerNavigationHelperImpl::OpenURL( |
| 72 GURL url, | 72 GURL url, |
| 73 WindowOpenDisposition disposition, | 73 WindowOpenDisposition disposition, |
| 74 bool user_clicked_on_link) { | 74 bool user_clicked_on_link) { |
| 75 content::PageTransition transition_type = user_clicked_on_link ? | 75 ui::PageTransition transition_type = user_clicked_on_link ? |
| 76 content::PAGE_TRANSITION_LINK : content::PAGE_TRANSITION_GENERATED; | 76 ui::PAGE_TRANSITION_LINK : ui::PAGE_TRANSITION_GENERATED; |
| 77 web_contents_->OpenURL(content::OpenURLParams( | 77 web_contents_->OpenURL(content::OpenURLParams( |
| 78 url, content::Referrer(), disposition, transition_type, false)); | 78 url, content::Referrer(), disposition, transition_type, false)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void GoogleURLTrackerNavigationHelperImpl::Observe( | 81 void GoogleURLTrackerNavigationHelperImpl::Observe( |
| 82 int type, | 82 int type, |
| 83 const content::NotificationSource& source, | 83 const content::NotificationSource& source, |
| 84 const content::NotificationDetails& details) { | 84 const content::NotificationDetails& details) { |
| 85 switch (type) { | 85 switch (type) { |
| 86 case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { | 86 case content::NOTIFICATION_NAV_ENTRY_COMMITTED: { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 104 DCHECK_EQ(web_contents_, | 104 DCHECK_EQ(web_contents_, |
| 105 content::Source<content::WebContents>(source).ptr()); | 105 content::Source<content::WebContents>(source).ptr()); |
| 106 google_url_tracker()->OnTabClosed(this); | 106 google_url_tracker()->OnTabClosed(this); |
| 107 break; | 107 break; |
| 108 } | 108 } |
| 109 | 109 |
| 110 default: | 110 default: |
| 111 NOTREACHED() << "Unknown notification received:" << type; | 111 NOTREACHED() << "Unknown notification received:" << type; |
| 112 } | 112 } |
| 113 } | 113 } |
| OLD | NEW |