| Index: chrome/browser/instant/instant_controller_impl.h
|
| diff --git a/chrome/browser/instant/instant_controller_impl.h b/chrome/browser/instant/instant_controller_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8c4fa46be3f43a74eb6641a9919a353eb6b46a06
|
| --- /dev/null
|
| +++ b/chrome/browser/instant/instant_controller_impl.h
|
| @@ -0,0 +1,122 @@
|
| +// 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_INSTANT_INSTANT_CONTROLLER_IMPL_H_
|
| +#define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_IMPL_H_
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/compiler_specific.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/string16.h"
|
| +#include "base/timer.h"
|
| +#include "chrome/browser/instant/instant_controller.h"
|
| +#include "chrome/browser/instant/instant_service_observer.h"
|
| +#include "content/public/common/page_transition_types.h"
|
| +#include "googleurl/src/gurl.h"
|
| +#include "ui/gfx/rect.h"
|
| +
|
| +class InstantOverlay;
|
| +class InstantOverlayModel;
|
| +class InstantService;
|
| +class Profile;
|
| +
|
| +namespace chrome {
|
| +class BrowserInstantController;
|
| +}
|
| +
|
| +class InstantControllerImpl : public InstantController,
|
| + public InstantServiceObserver {
|
| + public:
|
| + InstantControllerImpl(chrome::BrowserInstantController* browser,
|
| + Profile* profile);
|
| +
|
| + private:
|
| + virtual ~InstantControllerImpl();
|
| +
|
| + // Overridden from InstantController:
|
| + virtual bool Update(const AutocompleteMatch& match,
|
| + const string16& user_text,
|
| + const string16& full_text,
|
| + size_t selection_start,
|
| + size_t selection_end,
|
| + bool verbatim,
|
| + bool user_input_in_progress,
|
| + bool omnibox_popup_is_open,
|
| + bool escape_pressed,
|
| + bool is_keyword_search) OVERRIDE;
|
| + virtual void HandleAutocompleteResults(
|
| + const std::vector<AutocompleteProvider*>& providers) OVERRIDE;
|
| + virtual bool OnUpOrDownKeyPressed(int count) OVERRIDE;
|
| + virtual void OnCancel(const AutocompleteMatch& match,
|
| + const string16& full_text) OVERRIDE;
|
| + virtual bool IsOverlayingSearchResults() const OVERRIDE;
|
| + virtual content::WebContents* GetOverlayContents() const OVERRIDE;
|
| + virtual const InstantOverlayModel* model() const OVERRIDE;
|
| + virtual void AddOverlayModelObserver(
|
| + InstantOverlayModelObserver* observer) OVERRIDE;
|
| + virtual void RemoveOverlayModelObserver(
|
| + InstantOverlayModelObserver* observer) OVERRIDE;
|
| + virtual bool CommitIfPossible(InstantCommitType type) OVERRIDE;
|
| + virtual scoped_ptr<content::WebContents> ReleaseNTPContents() OVERRIDE;
|
| + virtual void SetPopupBounds(const gfx::Rect& bounds) OVERRIDE;
|
| + virtual void SetOmniboxBounds(const gfx::Rect& bounds) OVERRIDE;
|
| + virtual void OmniboxFocusChanged(OmniboxFocusState state,
|
| + OmniboxFocusChangeReason reason,
|
| + gfx::NativeView view_gaining_focus) OVERRIDE;
|
| + virtual void TabDeactivated(content::WebContents* contents) OVERRIDE;
|
| + virtual void SearchModeChanged(const chrome::search::Mode& old_mode,
|
| + const chrome::search::Mode& new_mode) OVERRIDE;
|
| + virtual void ActiveTabChanged() OVERRIDE;
|
| + virtual void SwappedOverlayContents() OVERRIDE;
|
| + virtual void FocusedOverlayContents() OVERRIDE;
|
| + virtual void RenderViewGone(const content::WebContents* contents) OVERRIDE;
|
| + virtual void InitSearchBox(const content::WebContents* contents) OVERRIDE;
|
| + virtual void InstantSupportDetermined(
|
| + const content::WebContents* contents) OVERRIDE;
|
| + virtual void SetSuggestion(const content::WebContents* contents,
|
| + const InstantSuggestion& suggestion) OVERRIDE;
|
| + virtual void NavigateToURL(const content::WebContents* contents,
|
| + const GURL& url,
|
| + content::PageTransition transition,
|
| + WindowOpenDisposition disposition) OVERRIDE;
|
| + virtual void ShowOverlay(const content::WebContents* contents,
|
| + int height,
|
| + InstantSizeUnits height_units) OVERRIDE;
|
| + virtual void SetFocusState(const content::WebContents* contents,
|
| + OmniboxFocusState focus_state) OVERRIDE;
|
| + virtual void DeleteMostVisitedItem(const content::WebContents* contents,
|
| + const GURL& url) OVERRIDE;
|
| + virtual void UndoMostVisitedItemDeletion(const content::WebContents* contents,
|
| + const GURL& url) OVERRIDE;
|
| + virtual void UndoAllMostVisitedItemDeletions(
|
| + const content::WebContents* contents) OVERRIDE;
|
| +
|
| + // Overridden from InstantServiceObserver:
|
| + virtual void InstantStatusChanged() OVERRIDE;
|
| + virtual void ThemeInfoChanged() OVERRIDE;
|
| + virtual void MostVisitedItemsChanged() OVERRIDE;
|
| +
|
| + bool IsOverlayBeingCommitted() const;
|
| + void ShowOverlay();
|
| + void HideOverlay();
|
| + void SendPopupBoundsToPage();
|
| +
|
| + chrome::BrowserInstantController* const browser_;
|
| + InstantService* const service_;
|
| + scoped_ptr<InstantOverlay> overlay_;
|
| + scoped_ptr<InstantOverlayModel> model_;
|
| +
|
| + string16 last_omnibox_text_;
|
| + bool last_verbatim_;
|
| + content::PageTransition last_transition_type_;
|
| + GURL url_for_history_;
|
| +
|
| + gfx::Rect popup_bounds_; // Current popup bounds.
|
| + gfx::Rect last_popup_bounds_; // Last popup bounds sent to the page.
|
| + base::OneShotTimer<InstantControllerImpl> update_bounds_timer_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(InstantControllerImpl);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_IMPL_H_
|
|
|