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

Unified Diff: ui/gfx/size_base.h

Issue 10802066: Adds support for saving favicon size into history database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: ui/gfx/size_base.h
diff --git a/ui/gfx/size_base.h b/ui/gfx/size_base.h
index f8373e8a802f79984fb1b4c9dae91616084fdaf1..44695d2b09318980e18bfe315f3a012362127bf1 100644
--- a/ui/gfx/size_base.h
+++ b/ui/gfx/size_base.h
@@ -51,6 +51,15 @@ class UI_EXPORT SizeBase {
return !(*this == s);
}
+ // A size is less than another size if its width is less than the |other|
+ // size's width. If the widths are equal, then the size with the smallest
+ // height is less than the other. The comparison is required to uses Sizes in
+ // sets and sorted vectors.
+ bool operator<(const Class& other) const {
+ return (width_ == other.width_) ?
+ height_ < other.height_ : width_ < other.width_;
+ }
+
bool IsEmpty() const {
// Size doesn't allow negative dimensions, so testing for 0 is enough.
return (width_ == 0) || (height_ == 0);

Powered by Google App Engine
This is Rietveld 408576698