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

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 1201063002: Set up the infrastructure for Extension event metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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
OLDNEW
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/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/chromeos/input_method/input_method_engine.h" 9 #include "chrome/browser/chromeos/input_method/input_method_engine.h"
10 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 10 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return; 332 return;
333 extensions::ProcessManager* process_manager = 333 extensions::ProcessManager* process_manager =
334 extensions::ProcessManager::Get(profile_); 334 extensions::ProcessManager::Get(profile_);
335 if (extensions::BackgroundInfo::HasBackgroundPage(extension) && 335 if (extensions::BackgroundInfo::HasBackgroundPage(extension) &&
336 !process_manager->GetBackgroundHostForExtension(extension_id_)) { 336 !process_manager->GetBackgroundHostForExtension(extension_id_)) {
337 return; 337 return;
338 } 338 }
339 } 339 }
340 } 340 }
341 341
342 scoped_ptr<extensions::Event> event( 342 scoped_ptr<extensions::Event> event(new extensions::Event(
343 new extensions::Event(event_name, args.Pass())); 343 extensions::events::UNKNOWN, event_name, args.Pass()));
344 event->restrict_to_browser_context = profile_; 344 event->restrict_to_browser_context = profile_;
345 extensions::EventRouter::Get(profile_) 345 extensions::EventRouter::Get(profile_)
346 ->DispatchEventToExtension(extension_id_, event.Pass()); 346 ->DispatchEventToExtension(extension_id_, event.Pass());
347 } 347 }
348 348
349 // Returns true if the extension is ready to accept key event, otherwise 349 // Returns true if the extension is ready to accept key event, otherwise
350 // returns false. 350 // returns false.
351 bool ShouldForwardKeyEvent() const { 351 bool ShouldForwardKeyEvent() const {
352 // Only forward key events to extension if there are non-lazy listeners 352 // Only forward key events to extension if there are non-lazy listeners
353 // for onKeyEvent. Because if something wrong with the lazy background 353 // for onKeyEvent. Because if something wrong with the lazy background
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 InputMethodEngineInterface* engine = 937 InputMethodEngineInterface* engine =
938 GetInputImeEventRouter( 938 GetInputImeEventRouter(
939 Profile::FromBrowserContext(details.browser_context)) 939 Profile::FromBrowserContext(details.browser_context))
940 ->GetActiveEngine(details.extension_id); 940 ->GetActiveEngine(details.extension_id);
941 // Notifies the IME extension for IME ready with onActivate/onFocus events. 941 // Notifies the IME extension for IME ready with onActivate/onFocus events.
942 if (engine) 942 if (engine)
943 engine->Enable(engine->GetActiveComponentId()); 943 engine->Enable(engine->GetActiveComponentId());
944 } 944 }
945 945
946 } // namespace extensions 946 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698