Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/extensions/api/input_ime/input_ime_api.h" | 5 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/common/extensions/api/input_ime.h" | 9 #include "chrome/common/extensions/api/input_ime.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputImeAPI> > | 405 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputImeAPI> > |
| 406 g_factory = LAZY_INSTANCE_INITIALIZER; | 406 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 407 | 407 |
| 408 // static | 408 // static |
| 409 BrowserContextKeyedAPIFactory<InputImeAPI>* InputImeAPI::GetFactoryInstance() { | 409 BrowserContextKeyedAPIFactory<InputImeAPI>* InputImeAPI::GetFactoryInstance() { |
| 410 return g_factory.Pointer(); | 410 return g_factory.Pointer(); |
| 411 } | 411 } |
| 412 | 412 |
| 413 InputImeEventRouter* GetInputImeEventRouter(Profile* profile) { | 413 InputImeEventRouter* GetInputImeEventRouter(Profile* profile) { |
| 414 if (!profile) | 414 if (!profile) |
| 415 return nullptr; | 415 return nullptr; |
|
Shu Chen
2016/04/19 07:27:17
the null check here seems unnecessary.
Azure Wei
2016/04/19 08:15:15
Removed.
| |
| 416 if (profile->HasOffTheRecordProfile()) | |
| 417 profile = profile->GetOffTheRecordProfile(); | |
| 418 return extensions::InputImeEventRouterFactory::GetInstance()->GetRouter( | 416 return extensions::InputImeEventRouterFactory::GetInstance()->GetRouter( |
| 419 profile); | 417 profile); |
| 420 } | 418 } |
| 421 | 419 |
| 422 } // namespace extensions | 420 } // namespace extensions |
| OLD | NEW |