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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

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: win fix Created 8 years, 10 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/toolbar_view.cc
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index b87ce3a29e75a0decb6ea7bfee53582407b5607d..04bd3bcb38a4cd3946c9e4c05b405884287dd8be 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/views/event_utils.h"
#include "chrome/browser/ui/views/window.h"
#include "chrome/browser/ui/views/wrench_menu.h"
+#include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
#include "chrome/browser/upgrade_detector.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
@@ -156,11 +157,15 @@ void ToolbarView::Init() {
forward_->set_id(VIEW_ID_FORWARD_BUTTON);
// Have to create this before |reload_| as |reload_|'s constructor needs it.
- location_bar_ = new LocationBarView(browser_, model_, this,
+ location_bar_ = new LocationBarView(
+ browser_->profile(),
+ browser_->command_updater(),
+ model_,
+ this,
(display_mode_ == DISPLAYMODE_LOCATION) ?
LocationBarView::POPUP : LocationBarView::NORMAL);
- reload_ = new ReloadButton(location_bar_, browser_);
+ reload_ = new ReloadButton(location_bar_, browser_->command_updater());
reload_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON |
ui::EF_MIDDLE_MOUSE_BUTTON);
reload_->set_tag(IDC_RELOAD);
@@ -352,6 +357,24 @@ InstantController* ToolbarView::GetInstant() {
return browser_->instant();
}
+BrowserShowContentRelated* ToolbarView::GetBrowserShowContentRelated() {
+ return browser_;
+}
+
+BrowserShowPageInfo* ToolbarView::GetBrowserShowPageInfo() {
+ return browser_;
+}
+
+views::Widget* ToolbarView::CreateViewsBubble(
+ views::BubbleDelegateView* bubble_delegate) {
+ return browser::CreateViewsBubble(bubble_delegate);
+}
+
+PageActionImageView* ToolbarView::CreatePageActionImageView(
+ LocationBarView* owner, ExtensionAction* action) {
+ return new PageActionImageView(owner, action, browser_);
+}
+
void ToolbarView::OnInputInProgress(bool in_progress) {
// The edit should make sure we're only notified when something changes.
DCHECK(model_->input_in_progress() != in_progress);

Powered by Google App Engine
This is Rietveld 408576698