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

Unified Diff: ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h

Issue 2589803002: Upstream Chrome on iOS source code [6/11]. (Closed)
Patch Set: Created 4 years 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/ui/omnibox/omnibox_popup_view_ios.h
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h
new file mode 100644
index 0000000000000000000000000000000000000000..3156eb62eb554f837cbef81581e840f458f4e1a4
--- /dev/null
+++ b/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h
@@ -0,0 +1,62 @@
+// Copyright (c) 2012 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 IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_IOS_H_
+#define IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_IOS_H_
+
+#include <UIKit/UIKit.h>
+
+#include <memory>
+
+#include "base/mac/scoped_nsobject.h"
+#include "base/strings/string16.h"
+#include "components/omnibox/browser/omnibox_popup_view.h"
+
+struct AutocompleteMatch;
+class OmniboxEditModel;
+@class OmniboxPopupMaterialViewController;
+class OmniboxPopupModel;
+@protocol OmniboxPopupPositioner;
+class OmniboxViewIOS;
+
+// iOS implementation of AutocompletePopupView.
+class OmniboxPopupViewIOS : public OmniboxPopupView {
+ public:
+ OmniboxPopupViewIOS(OmniboxViewIOS* edit_view,
+ OmniboxEditModel* edit_model,
+ id<OmniboxPopupPositioner> positioner);
+ ~OmniboxPopupViewIOS() override;
+
+ // AutocompletePopupView implementation.
+ bool IsOpen() const override;
+ void InvalidateLine(size_t line) override {}
+ void OnLineSelected(size_t line) override {}
+ void UpdatePopupAppearance() override;
+ gfx::Rect GetTargetBounds() override;
+ void PaintUpdatesNow() override {}
+ void OnDragCanceled() override {}
+
+ void OpenURLForRow(size_t row);
+ void DidScroll();
+ void UpdateEditViewIcon();
+ void CopyToOmnibox(const base::string16& text);
+ void SetTextAlignment(NSTextAlignment alignment);
+ bool IsStarredMatch(const AutocompleteMatch& match) const;
+ void DeleteMatch(const AutocompleteMatch& match) const;
+
+ private:
+ std::unique_ptr<OmniboxPopupModel> model_;
+ OmniboxViewIOS* edit_view_; // weak, owns this instance
+ id<OmniboxPopupPositioner> positioner_; // weak
+ // View that contains the omnibox popup table view and shadow.
+ base::scoped_nsobject<UIView> popupView_;
+ base::scoped_nsobject<OmniboxPopupMaterialViewController> popup_controller_;
+ bool is_open_;
+ // Animate the appearance of the omnibox popup view.
+ void AnimateDropdownExpansion(CGFloat parentHeight);
+ // Animate the disappearance of the omnibox popup view.
+ void AnimateDropdownCollapse();
+};
+
+#endif // IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_IOS_H_
« no previous file with comments | « ios/chrome/browser/ui/omnibox/omnibox_popup_positioner.h ('k') | ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698