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 7 namespace chromeos { 8 namespace input_method { 9 10 MockCandidateWindowController::MockCandidateWindowController() 11 : init_count_(0), 12 add_observer_count_(0), 13 remove_observer_count_(0) { 14 } 15 16 MockCandidateWindowController::~MockCandidateWindowController() { 17 } 18 19 bool MockCandidateWindowController::Init() { 20 ++init_count_; 21 return true; 22 } 23 24 void MockCandidateWindowController::Shutdown() { 25 } 26 27 void MockCandidateWindowController::AddObserver( 28 CandidateWindowController::Observer* observer) { 29 ++add_observer_count_; 30 observers_.AddObserver(observer); 31 } 32 33 void MockCandidateWindowController::RemoveObserver( 34 CandidateWindowController::Observer* observer) { 35 ++remove_observer_count_; 36 observers_.RemoveObserver(observer); 37 } 38 39 void MockCandidateWindowController::NotifyCandidateWindowOpened() { 40 FOR_EACH_OBSERVER(CandidateWindowController::Observer, observers_, 41 CandidateWindowOpened()); 42 } 43 44 void MockCandidateWindowController::NotifyCandidateWindowClosed() { 45 FOR_EACH_OBSERVER(CandidateWindowController::Observer, observers_, 46 CandidateWindowClosed()); 47 } 48 49 } // namespace input_method 50 } // namespace chromeos 51