Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4530)

Unified Diff: chrome/browser/google/google_url_tracker.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/google/google_url_tracker.h ('k') | chrome/browser/google/google_url_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google/google_url_tracker.cc
===================================================================
--- chrome/browser/google/google_url_tracker.cc (revision 91968)
+++ chrome/browser/google/google_url_tracker.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/navigation_controller.h"
@@ -257,9 +258,10 @@
google_url_.spec());
g_browser_process->local_state()->SetString(prefs::kLastPromptedGoogleURL,
google_url_.spec());
- NotificationService::current()->Notify(NotificationType::GOOGLE_URL_UPDATED,
- NotificationService::AllSources(),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_GOOGLE_URL_UPDATED,
+ NotificationService::AllSources(),
+ NotificationService::NoDetails());
need_to_prompt_ = false;
}
@@ -288,26 +290,26 @@
PageTransition::GENERATED);
}
-void GoogleURLTracker::Observe(NotificationType type,
+void GoogleURLTracker::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::NAV_ENTRY_PENDING: {
+ switch (type) {
+ case content::NOTIFICATION_NAV_ENTRY_PENDING: {
NavigationController* controller =
Source<NavigationController>(source).ptr();
OnNavigationPending(source, controller->pending_entry()->url());
break;
}
- case NotificationType::NAV_ENTRY_COMMITTED:
- case NotificationType::TAB_CLOSED:
+ case content::NOTIFICATION_NAV_ENTRY_COMMITTED:
+ case content::NOTIFICATION_TAB_CLOSED:
OnNavigationCommittedOrTabClosed(
Source<NavigationController>(source).ptr()->tab_contents(),
- type.value);
+ type);
break;
default:
- NOTREACHED() << "Unknown notification received:" << type.value;
+ NOTREACHED() << "Unknown notification received:" << type;
}
}
@@ -320,7 +322,7 @@
if (registrar_.IsEmpty() && (need_to_prompt_ || fetcher_.get())) {
// This notification will fire a bit later in the same call chain we're
// currently in.
- registrar_.Add(this, NotificationType::NAV_ENTRY_PENDING,
+ registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
NotificationService::AllSources());
}
}
@@ -329,22 +331,22 @@
const GURL& pending_url) {
controller_ = Source<NavigationController>(source).ptr();
search_url_ = pending_url;
- registrar_.Remove(this, NotificationType::NAV_ENTRY_PENDING,
+ registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
NotificationService::AllSources());
// Start listening for the commit notification. We also need to listen for the
// tab close command since that means the load will never commit.
- registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
+ registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
Source<NavigationController>(controller_));
- registrar_.Add(this, NotificationType::TAB_CLOSED,
+ registrar_.Add(this, content::NOTIFICATION_TAB_CLOSED,
Source<NavigationController>(controller_));
}
void GoogleURLTracker::OnNavigationCommittedOrTabClosed(
TabContents* tab_contents,
- NotificationType::Type type) {
+ int type) {
registrar_.RemoveAll();
- if (type == NotificationType::NAV_ENTRY_COMMITTED) {
+ if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
ShowGoogleURLInfoBarIfNecessary(tab_contents);
} else {
controller_ = NULL;
« no previous file with comments | « chrome/browser/google/google_url_tracker.h ('k') | chrome/browser/google/google_url_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698