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

Side by Side 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: Modified tests, answered Sreeram. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CONTROLLER_H_
7
8 #include "base/basictypes.h"
Peter Kasting 2013/04/25 18:24:55 Is this #include needed?
beaudoin 2013/04/25 19:14:57 Gone. Done.
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
12
13 class AutocompleteController;
14 class OmniboxEditModel;
15 class Profile;
16
17 // This class sits between the OmniboxEditModel and AutocompleteController.
Peter Kasting 2013/04/25 18:24:55 Nit: This comment isn't really informative about w
beaudoin 2013/04/25 20:34:51 I was torn between describing what this class will
18 // TODO(beaudoin): Keep on expanding this class so that OmniboxEditModel no
19 // longer needs to hold any reference to AutocompleteController. Also make
20 // this the point of contact between InstantController and OmniboxEditModel.
21 class OmniboxController : public AutocompleteControllerDelegate {
22
23 public:
24 OmniboxController(OmniboxEditModel* omnibox_edit_model, Profile* profile);
25 virtual ~OmniboxController();
26
27 AutocompleteController* autocomplete_controller() const {
Peter Kasting 2013/04/25 18:24:55 Const methods must not return non-const pointers.
beaudoin 2013/04/25 20:34:51 The exact same method is defined in omnibox_edit_m
Peter Kasting 2013/04/25 20:52:09 I'd probably skip the TODO. I doubt we can avoid
beaudoin 2013/04/25 23:51:33 Done.
28 return autocomplete_controller_.get();
29 }
30
31 // AutocompleteControllerDelegate:
Peter Kasting 2013/04/25 18:24:55 I suggest putting overrides above non-overrides.
beaudoin 2013/04/25 20:34:51 Done.
32 virtual void OnResultChanged(bool default_match_changed) OVERRIDE;
33
34 private:
35 // Weak, it owns us.
36 // TODO(beaudoin): When we have a clearer picture of the interface between
37 // this and OmniboxEditModel define and use a Delegate interface instead.
Peter Kasting 2013/04/25 18:24:55 Why? Is there a real win in defining such an inte
beaudoin 2013/04/25 20:34:51 Such an interface may make unit tests easier. In t
Peter Kasting 2013/04/25 20:52:09 Ah. That's a reasonable justification. Maybe jus
38 OmniboxEditModel* omnibox_edit_model_;
39
40 scoped_ptr<AutocompleteController> autocomplete_controller_;
41
42 DISALLOW_COPY_AND_ASSIGN(OmniboxController);
43 };
44
45 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_controller.cc » ('j') | chrome/browser/ui/omnibox/omnibox_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698