mock_component_extension_ime_manager_delegate.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
1// Copyright 2013 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#ifndef CHROMEOS_IME_MOCK_COMPONENT_EXTENSION_IME_MANAGER_DELEGATE_H_
6#define CHROMEOS_IME_MOCK_COMPONENT_EXTENSION_IME_MANAGER_DELEGATE_H_
7
8#include "chromeos/chromeos_export.h"
9#include "chromeos/ime/component_extension_ime_manager.h"
10
11namespace chromeos {
12namespace input_method {
13
14class CHROMEOS_EXPORT MockComponentExtIMEManagerDelegate
15    : public ComponentExtensionIMEManagerDelegate {
16 public:
17  MockComponentExtIMEManagerDelegate();
18  virtual ~MockComponentExtIMEManagerDelegate();
19
20  virtual std::vector<ComponentExtensionIME> ListIME() OVERRIDE;
21  virtual bool Load(const std::string& extension_id,
22                    const std::string& manifest,
23                    const base::FilePath& path) OVERRIDE;
24  virtual void Unload(const std::string& extension_id,
25                      const base::FilePath& path) OVERRIDE;
26
27  int load_call_count() const { return load_call_count_; }
28  int unload_call_count() const { return unload_call_count_; }
29  const std::string& last_loaded_extension_id() const {
30    return last_loaded_extension_id_;
31  }
32  const std::string& last_unloaded_extension_id() const {
33    return last_unloaded_extension_id_;
34  }
35  const base::FilePath& last_loaded_file_path() const {
36    return last_loaded_file_path_;
37  }
38  const base::FilePath& last_unloaded_file_path() const {
39    return last_unloaded_file_path_;
40  }
41  void set_ime_list(const std::vector<ComponentExtensionIME>& ime_list) {
42    ime_list_ = ime_list;
43  }
44
45 private:
46  int load_call_count_;
47  int unload_call_count_;
48  std::string last_loaded_extension_id_;
49  std::string last_unloaded_extension_id_;
50  base::FilePath last_loaded_file_path_;
51  base::FilePath last_unloaded_file_path_;
52
53  std::vector<ComponentExtensionIME> ime_list_;
54
55  DISALLOW_COPY_AND_ASSIGN(MockComponentExtIMEManagerDelegate);
56};
57
58}  // namespace input_method
59}  // namespace chromeos
60
61#endif  // CHROMEOS_IME_MOCK_COMPONENT_EXTENSION_IME_MANAGER_DELEGATE_H_
62