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

Side by Side Diff: chrome/browser/chromeos/extensions/input_method_event_router.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "input_method_event_router.h" 5 #include "input_method_event_router.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 24 matching lines...) Expand all
35 return std::binary_search(ids_.begin(), ids_.end(), id); 35 return std::binary_search(ids_.begin(), ids_.end(), id);
36 } 36 }
37 37
38 const std::vector<std::string>& ids() { return ids_; } 38 const std::vector<std::string>& ids() { return ids_; }
39 39
40 private: 40 private:
41 std::vector<std::string> ids_; 41 std::vector<std::string> ids_;
42 }; 42 };
43 43
44 base::LazyInstance<InputMethodPrivateExtensionsWhitelist> 44 base::LazyInstance<InputMethodPrivateExtensionsWhitelist>
45 g_input_method_private_extensions_whitelist(base::LINKER_INITIALIZED); 45 g_input_method_private_extensions_whitelist = LAZY_INSTANCE_INITIALIZER;
46 46
47 } // namespace 47 } // namespace
48 48
49 namespace chromeos { 49 namespace chromeos {
50 50
51 ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() { 51 ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() {
52 input_method::InputMethodManager::GetInstance()->AddObserver(this); 52 input_method::InputMethodManager::GetInstance()->AddObserver(this);
53 } 53 }
54 54
55 ExtensionInputMethodEventRouter::~ExtensionInputMethodEventRouter() { 55 ExtensionInputMethodEventRouter::~ExtensionInputMethodEventRouter() {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 DCHECK(xkb_id.substr(0, prefix_length) == kXkbPrefix); 102 DCHECK(xkb_id.substr(0, prefix_length) == kXkbPrefix);
103 return xkb_id.substr(prefix_length); 103 return xkb_id.substr(prefix_length);
104 } 104 }
105 105
106 bool ExtensionInputMethodEventRouter::IsExtensionWhitelisted( 106 bool ExtensionInputMethodEventRouter::IsExtensionWhitelisted(
107 const std::string& extension_id) { 107 const std::string& extension_id) {
108 return g_input_method_private_extensions_whitelist.Get().HasId(extension_id); 108 return g_input_method_private_extensions_whitelist.Get().HasId(extension_id);
109 } 109 }
110 110
111 } // namespace chromeos 111 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros_settings.cc ('k') | chrome/browser/chromeos/login/ownership_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698