OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/search/instant_service_observer.h" | 10 #include "chrome/browser/search/instant_service_observer.h" |
11 #include "chrome/browser/ui/search/instant_controller.h" | 11 #include "chrome/browser/ui/search/instant_controller.h" |
12 #include "chrome/browser/ui/search/search_model_observer.h" | 12 #include "chrome/browser/ui/search/search_model_observer.h" |
13 | 13 |
14 class Browser; | 14 class Browser; |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 } | 19 } |
20 | 20 |
21 class BrowserInstantController : public SearchModelObserver, | 21 class BrowserInstantController : public SearchModelObserver, |
22 public InstantServiceObserver { | 22 public InstantServiceObserver { |
23 public: | 23 public: |
24 explicit BrowserInstantController(Browser* browser); | 24 explicit BrowserInstantController(Browser* browser); |
25 ~BrowserInstantController() override; | 25 ~BrowserInstantController() override; |
26 | 26 |
27 // Commits the current Instant, returning true on success. This is intended | 27 // Commits the current Instant. This is intended for use from OpenCurrentURL. |
28 // for use from OpenCurrentURL. | 28 void OpenInstant(WindowOpenDisposition disposition, const GURL& url); |
29 bool OpenInstant(WindowOpenDisposition disposition, const GURL& url); | |
30 | 29 |
31 // Returns the Profile associated with the Browser that owns this object. | 30 // Returns the Profile associated with the Browser that owns this object. |
32 Profile* profile() const; | 31 Profile* profile() const; |
33 | 32 |
34 // Returns the InstantController or NULL if there is no InstantController for | 33 // Returns the InstantController or NULL if there is no InstantController for |
35 // this BrowserInstantController. | 34 // this BrowserInstantController. |
36 InstantController* instant() { return &instant_; } | 35 InstantController* instant() { return &instant_; } |
37 | 36 |
38 // Invoked by |instant_| to get the currently active tab. | 37 // Invoked by |instant_| to get the currently active tab. |
39 content::WebContents* GetActiveWebContents() const; | 38 content::WebContents* GetActiveWebContents() const; |
(...skipping 19 matching lines...) Expand all Loading... |
59 std::unique_ptr<content::WebContents> new_contents); | 58 std::unique_ptr<content::WebContents> new_contents); |
60 | 59 |
61 Browser* const browser_; | 60 Browser* const browser_; |
62 | 61 |
63 InstantController instant_; | 62 InstantController instant_; |
64 | 63 |
65 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); | 64 DISALLOW_COPY_AND_ASSIGN(BrowserInstantController); |
66 }; | 65 }; |
67 | 66 |
68 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ | 67 #endif // CHROME_BROWSER_UI_BROWSER_INSTANT_CONTROLLER_H_ |
OLD | NEW |