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

Unified Diff: chrome/browser/ui/toolbar/toolbar_model.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: 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
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model.h ('k') | chrome/browser/ui/toolbar/toolbar_model_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/toolbar_model.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc
index b76982972c8e13d0e9dce9a60abab5f31d24fa60..2a7e2439a9a314852db164f12f6e5bd06a777627 100644
--- a/chrome/browser/ui/toolbar/toolbar_model.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/ssl_error_info.h"
-#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/toolbar/toolbar_model_delegate.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -32,8 +32,8 @@ using content::NavigationEntry;
using content::SSLStatus;
using content::WebContents;
-ToolbarModel::ToolbarModel(Browser* browser)
- : browser_(browser),
+ToolbarModel::ToolbarModel(ToolbarModelDelegate* delegate)
+ : delegate_(delegate),
input_in_progress_(false) {
}
@@ -84,7 +84,7 @@ bool ToolbarModel::ShouldDisplayURL() const {
}
}
- WebContents* web_contents = browser_->GetSelectedWebContents();
+ WebContents* web_contents = delegate_->GetActiveWebContents();
if (web_contents && web_contents->GetWebUIForCurrentState())
return !web_contents->GetWebUIForCurrentState()->ShouldHideURL();
@@ -174,6 +174,6 @@ NavigationController* ToolbarModel::GetNavigationController() const {
// This |current_tab| can be NULL during the initialization of the
// toolbar during window creation (i.e. before any tabs have been added
// to the window).
- WebContents* current_tab = browser_->GetSelectedWebContents();
+ WebContents* current_tab = delegate_->GetActiveWebContents();
return current_tab ? &current_tab->GetController() : NULL;
}
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model.h ('k') | chrome/browser/ui/toolbar/toolbar_model_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698