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

Unified Diff: chrome/browser/translate/translate_manager.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
Index: chrome/browser/translate/translate_manager.cc
===================================================================
--- chrome/browser/translate/translate_manager.cc (revision 91771)
+++ chrome/browser/translate/translate_manager.cc (working copy)
@@ -26,6 +26,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.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 "chrome/common/render_messages.h"
@@ -294,7 +295,7 @@
helper->language_state().original_language()));
break;
}
- case NotificationType::TAB_LANGUAGE_DETERMINED: {
+ case chrome::TAB_LANGUAGE_DETERMINED: {
TabContents* tab = Source<TabContents>(source).ptr();
// We may get this notifications multiple times. Make sure to translate
// only once.
@@ -311,7 +312,7 @@
}
break;
}
- case NotificationType::PAGE_TRANSLATED: {
+ case chrome::PAGE_TRANSLATED: {
// Only add translate infobar if it doesn't exist; if it already exists,
// just update the state, the actual infobar would have received the same
// notification and update the visual display accordingly.
@@ -321,9 +322,9 @@
PageTranslated(tab, page_translated_details);
break;
}
- case NotificationType::PROFILE_DESTROYED: {
+ case chrome::PROFILE_DESTROYED: {
Profile* profile = Source<Profile>(source).ptr();
- notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED,
+ notification_registrar_.Remove(this, chrome::PROFILE_DESTROYED,
source);
size_t count = accept_languages_.erase(profile->GetPrefs());
// We should know about this profile since we are listening for
@@ -332,7 +333,7 @@
pref_change_registrar_.Remove(prefs::kAcceptLanguages, this);
break;
}
- case NotificationType::PREF_CHANGED: {
+ case chrome::PREF_CHANGED: {
DCHECK(*Details<std::string>(details).ptr() == prefs::kAcceptLanguages);
PrefService* prefs = Source<PrefService>(source).ptr();
InitAcceptLanguages(prefs);
@@ -424,9 +425,9 @@
translate_script_expiration_delay_(kTranslateScriptExpirationDelayMS) {
notification_registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::TAB_LANGUAGE_DETERMINED,
+ notification_registrar_.Add(this, chrome::TAB_LANGUAGE_DETERMINED,
NotificationService::AllSources());
- notification_registrar_.Add(this, NotificationType::PAGE_TRANSLATED,
+ notification_registrar_.Add(this, chrome::PAGE_TRANSLATED,
NotificationService::AllSources());
}
@@ -653,7 +654,7 @@
InitAcceptLanguages(pref_service);
// Listen for this profile going away, in which case we would need to clear
// the accepted languages for the profile.
- notification_registrar_.Add(this, NotificationType::PROFILE_DESTROYED,
+ notification_registrar_.Add(this, chrome::PROFILE_DESTROYED,
Source<Profile>(tab->profile()));
// Also start listening for changes in the accept languages.
pref_change_registrar_.Add(prefs::kAcceptLanguages, this);

Powered by Google App Engine
This is Rietveld 408576698