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

Unified Diff: chrome/browser/ui/browser.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: comments fix 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/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 7fe897a0b3083dd231107620bec656c80e92074c..9ce37c8ac5a08bc45229ea086816b4d41008bec3 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -104,9 +104,11 @@
#include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h"
#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
+#include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/browser_tab_contents_wrapper_container.h"
#include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/constrained_window_tab_helper.h"
@@ -340,7 +342,6 @@ Browser::Browser(Type type, Profile* profile)
ALLOW_THIS_IN_INITIALIZER_LIST(
tab_handler_(TabHandler::CreateTabHandler(this))),
command_updater_(this),
- toolbar_model_(this),
chrome_updater_factory_(this),
is_attempting_to_close_browser_(false),
cancel_download_confirmation_state_(NOT_PROMPTED),
@@ -352,6 +353,12 @@ Browser::Browser(Type type, Profile* profile)
last_blocked_command_disposition_(CURRENT_TAB),
pending_web_app_action_(NONE),
ALLOW_THIS_IN_INITIALIZER_LIST(
+ content_setting_bubble_model_delegate_(
+ new BrowserContentSettingBubbleModelDelegate(this))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(
+ tab_contents_wrapper_container_(
+ new BrowserTabContentsWrapperContainer(this))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(
tab_restore_service_delegate_(
new BrowserTabRestoreServiceDelegate(this))),
ALLOW_THIS_IN_INITIALIZER_LIST(
@@ -359,6 +366,8 @@ Browser::Browser(Type type, Profile* profile)
new BrowserSyncedWindowDelegate(this))),
bookmark_bar_state_(BookmarkBar::HIDDEN),
window_has_shown_(false) {
+ toolbar_model_.reset(new ToolbarModel(tab_contents_wrapper_container()));
+
registrar_.Add(this, content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
content::NotificationService::AllSources());
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
@@ -1861,7 +1870,7 @@ void Browser::WriteCurrentURLToClipboard() {
// RenderContextViewMenu.
WebContents* contents = GetSelectedWebContents();
- if (!toolbar_model_.ShouldDisplayURL())
+ if (!toolbar_model_->ShouldDisplayURL())
return;
chrome_browser_net::WriteURLToClipboard(
@@ -4908,7 +4917,7 @@ void Browser::UpdateCommandsForTabState() {
command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
current_tab->GetController().CanViewSource());
command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION,
- toolbar_model_.ShouldDisplayURL() && current_tab->GetURL().is_valid());
+ toolbar_model_->ShouldDisplayURL() && current_tab->GetURL().is_valid());
if (is_devtools())
command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);

Powered by Google App Engine
This is Rietveld 408576698