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

Unified Diff: chrome/common/page_transition_types.cc

Issue 2934004: Try to cut down Browser/TabContents header dependencies. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix unit tests compile Created 10 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/common/page_transition_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/page_transition_types.cc
diff --git a/chrome/common/page_transition_types.cc b/chrome/common/page_transition_types.cc
index 9fb49cd2d08812892c823c82ebcec37b35041efc..bf686f9abb150b24e504e4c7425823197272aab5 100644
--- a/chrome/common/page_transition_types.cc
+++ b/chrome/common/page_transition_types.cc
@@ -4,6 +4,20 @@
#include "chrome/common/page_transition_types.h"
+#include "base/logging.h"
+
+// static
+PageTransition::Type PageTransition::FromInt(int32 type) {
+ if (!ValidType(type)) {
+ NOTREACHED() << "Invalid transition type " << type;
+
+ // Return a safe default so we don't have corrupt data in release mode.
+ return LINK;
+ }
+ return static_cast<Type>(type);
+}
+
+// static
const char* PageTransition::CoreTransitionString(Type type) {
switch (type & PageTransition::CORE_MASK) {
case 0: return "link";
« no previous file with comments | « chrome/common/page_transition_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698