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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.h

Issue 9479008: Re-factor location bar/toolbar code to get rid of the browser dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: call right overloaded method Created 8 years, 9 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
Index: chrome/browser/ui/views/location_bar/location_bar_view.h
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h
index 4781c21258d9bd41d64b95fa26bc7b693de020a9..15de38623515586cb7c602eef53445170e77ac43 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.h
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.h
@@ -32,8 +32,9 @@
#include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h"
#endif
-class Browser;
class ChromeToMobileView;
+class CommandUpdater;
+class ContentSettingBubbleModelDelegate;
class ContentSettingImageView;
class EVBubbleView;
class ExtensionAction;
@@ -42,11 +43,18 @@ class InstantController;
class KeywordHintView;
class LocationIconView;
class PageActionWithBadgeView;
+class PageActionImageView;
+class Profile;
class SelectedKeywordView;
class StarView;
class TabContentsWrapper;
class TemplateURLService;
+namespace views {
+class BubbleDelegateView;
+class Widget;
+}
+
#if defined(OS_WIN) || defined(USE_AURA)
class SuggestedTextView;
#endif
@@ -86,10 +94,32 @@ class LocationBarView : public LocationBar,
// Returns the InstantController, or NULL if there isn't one.
virtual InstantController* GetInstant() = 0;
+ // Creates Widget for the given delegate.
+ virtual views::Widget* CreateViewsBubble(
+ views::BubbleDelegateView* bubble_delegate) = 0;
+
+ // Creates PageActionImageView. Caller gets an ownership.
+ virtual PageActionImageView* CreatePageActionImageView(
+ LocationBarView* owner,
+ ExtensionAction* action) = 0;
+
+ // Returns ContentSettingBubbleModelDelegate.
+ virtual ContentSettingBubbleModelDelegate*
+ GetContentSettingBubbleModelDelegate() = 0;
+
+ // Shows page information in the given web contents.
+ virtual void ShowPageInfo(content::WebContents* web_contents,
+ const GURL& url,
+ const content::SSLStatus& ssl,
+ bool show_history) = 0;
+
// Called by the location bar view when the user starts typing in the edit.
// This forces our security style to be UNKNOWN for the duration of the
// editing.
virtual void OnInputInProgress(bool in_progress) = 0;
+
+ protected:
+ virtual ~Delegate() {}
};
enum ColorKind {
@@ -112,10 +142,12 @@ class LocationBarView : public LocationBar,
APP_LAUNCHER
};
- LocationBarView(Browser* browser,
+ LocationBarView(Profile* profile,
+ CommandUpdater* command_updater,
ToolbarModel* model,
Delegate* delegate,
Mode mode);
+
virtual ~LocationBarView();
void Init();
@@ -134,7 +166,11 @@ class LocationBarView : public LocationBar,
// saved state that the tab holds.
void Update(const content::WebContents* tab_for_state_restoring);
- Browser* browser() const { return browser_; }
+ // Returns corresponding profile.
+ Profile* profile() const { return profile_; }
+
+ // Returns the delegate.
+ Delegate* delegate() const { return delegate_; }
// Sets |preview_enabled| for the PageAction View associated with this
// |page_action|. If |preview_enabled| is true, the view will display the
@@ -352,8 +388,11 @@ class LocationBarView : public LocationBar,
// The Autocomplete Edit field.
scoped_ptr<OmniboxView> location_entry_;
- // The Browser object that corresponds to this View.
- Browser* browser_;
+ // The profile which corresponds to this View.
+ Profile* profile_;
+
+ // Command updater which corresponds to this View.
+ CommandUpdater* command_updater_;
// The model.
ToolbarModel* model_;

Powered by Google App Engine
This is Rietveld 408576698