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

Unified Diff: chrome/browser/ui/omnibox/omnibox_controller.h

Issue 13932034: Omnibox refactor, introduced OmniboxController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_controller.h
diff --git a/chrome/browser/ui/omnibox/omnibox_controller.h b/chrome/browser/ui/omnibox/omnibox_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..736fcad89bdc889a692a4adc13f16df6a70c3978
--- /dev/null
+++ b/chrome/browser/ui/omnibox/omnibox_controller.h
@@ -0,0 +1,47 @@
+// Copyright 2013 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.
+
+#ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CONTROLLER_H_
+#define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CONTROLLER_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
+
+class AutocompleteController;
+class OmniboxEditModel;
+class Profile;
+
+// This class controls the various services that can modify the content
+// for the omnibox, including AutocompleteController and InstantController. It
+// is responsible of updating the omnibox content.
+// TODO(beaudoin): Keep on expanding this class so that OmniboxEditModel no
+// longer needs to hold any reference to AutocompleteController. Also make
+// this the point of contact between InstantController and OmniboxEditModel.
+// As the refactor progresses, keep the class comment up-to-date to
+// precisely explain what this class is doing.
+class OmniboxController : public AutocompleteControllerDelegate {
+
+ public:
+ OmniboxController(OmniboxEditModel* omnibox_edit_model, Profile* profile);
+ virtual ~OmniboxController();
+
+ // AutocompleteControllerDelegate:
+ virtual void OnResultChanged(bool default_match_changed) OVERRIDE;
+
+ AutocompleteController* autocomplete_controller() {
+ return autocomplete_controller_.get();
+ }
+
+ private:
+ // Weak, it owns us.
+ // TODO(beaudoin): Consider defining a delegate to ease unit testing.
+ OmniboxEditModel* omnibox_edit_model_;
+
+ scoped_ptr<AutocompleteController> autocomplete_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(OmniboxController);
+};
+
+#endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CONTROLLER_H_
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698