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

Unified Diff: ios/chrome/browser/omnibox/omnibox_edit_model_observer_relay.cc

Issue 1245683002: Implements N:M forwarding of OmniboxEditModel events on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/omnibox/omnibox_edit_model_observer_relay.cc
diff --git a/ios/chrome/browser/omnibox/omnibox_edit_model_observer_relay.cc b/ios/chrome/browser/omnibox/omnibox_edit_model_observer_relay.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4b84ea3219883be14754e79050539f7c24502358
--- /dev/null
+++ b/ios/chrome/browser/omnibox/omnibox_edit_model_observer_relay.cc
@@ -0,0 +1,24 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/omnibox/omnibox_edit_model_observer_relay.h"
+
+#include "base/memory/singleton.h"
+
+OmniboxEditModelObserverRelay* OmniboxEditModelObserverRelay::GetInstance() {
+ return Singleton<OmniboxEditModelObserverRelay>::get();
+}
+
+scoped_ptr<base::CallbackList<void(OmniboxLog*)>::Subscription>
+OmniboxEditModelObserverRelay::RegisterCallback(const OnURLOpenedCallback& cb) {
+ return on_url_opened_callback_list_.Add(cb);
+}
+
+void OmniboxEditModelObserverRelay::OnURLOpened(OmniboxLog* log) {
+ on_url_opened_callback_list_.Notify(log);
+}
+
+OmniboxEditModelObserverRelay::OmniboxEditModelObserverRelay() {}
+
+OmniboxEditModelObserverRelay::~OmniboxEditModelObserverRelay() {}

Powered by Google App Engine
This is Rietveld 408576698