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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_property.cc

Issue 10025015: Add operator= to InputMethodProperty. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added operator!= per offline discussion Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/chromeos/input_method/input_method_property.h" 5 #include "chrome/browser/chromeos/input_method/input_method_property.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 InputMethodProperty::InputMethodProperty() 27 InputMethodProperty::InputMethodProperty()
28 : is_selection_item(false), 28 : is_selection_item(false),
29 is_selection_item_checked(false), 29 is_selection_item_checked(false),
30 selection_item_id(kInvalidSelectionItemId) { 30 selection_item_id(kInvalidSelectionItemId) {
31 } 31 }
32 32
33 InputMethodProperty::~InputMethodProperty() { 33 InputMethodProperty::~InputMethodProperty() {
34 } 34 }
35 35
36 bool InputMethodProperty::operator==(const InputMethodProperty& other) const {
37 return key == other.key &&
38 label == other.label &&
39 is_selection_item == other.is_selection_item &&
40 is_selection_item_checked == other.is_selection_item_checked &&
41 selection_item_id == other.selection_item_id;
42 }
43
44 bool InputMethodProperty::operator!=(const InputMethodProperty& other) const {
45 return !(*this == other);
46 }
47
36 std::string InputMethodProperty::ToString() const { 48 std::string InputMethodProperty::ToString() const {
37 std::stringstream stream; 49 std::stringstream stream;
38 stream << "key=" << key 50 stream << "key=" << key
39 << ", label=" << label 51 << ", label=" << label
40 << ", is_selection_item=" << is_selection_item 52 << ", is_selection_item=" << is_selection_item
41 << ", is_selection_item_checked=" << is_selection_item_checked 53 << ", is_selection_item_checked=" << is_selection_item_checked
42 << ", selection_item_id=" << selection_item_id; 54 << ", selection_item_id=" << selection_item_id;
43 return stream.str(); 55 return stream.str();
44 } 56 }
45 57
46 } // namespace input_method 58 } // namespace input_method
47 } // namespace chromeos 59 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698