mock_candidate_window_controller.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
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 3// found in the LICENSE file. 4 5#include "chrome/browser/chromeos/input_method/mock_candidate_window_controller.h" 6 7namespace chromeos { 8namespace input_method { 9 10MockCandidateWindowController::MockCandidateWindowController() 11 : init_count_(0), 12 add_observer_count_(0), 13 remove_observer_count_(0) { 14} 15 16MockCandidateWindowController::~MockCandidateWindowController() { 17} 18 19bool MockCandidateWindowController::Init() { 20 ++init_count_; 21 return true; 22} 23 24void MockCandidateWindowController::AddObserver( 25 CandidateWindowController::Observer* observer) { 26 ++add_observer_count_; 27 observers_.AddObserver(observer); 28} 29 30void MockCandidateWindowController::RemoveObserver( 31 CandidateWindowController::Observer* observer) { 32 ++remove_observer_count_; 33 observers_.RemoveObserver(observer); 34} 35 36void MockCandidateWindowController::NotifyCandidateWindowOpened() { 37 FOR_EACH_OBSERVER(CandidateWindowController::Observer, observers_, 38 CandidateWindowOpened()); 39} 40 41void MockCandidateWindowController::NotifyCandidateWindowClosed() { 42 FOR_EACH_OBSERVER(CandidateWindowController::Observer, observers_, 43 CandidateWindowClosed()); 44} 45 46} // namespace input_method 47} // namespace chromeos 48