diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 00:04:51 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 00:04:51 +0000 |
commit | 6934a70facaac1c8f400f0740a3e6fe9697bb4a8 (patch) | |
tree | fed96e821d5499f078a5378e985a7745755d1f75 /chrome/browser | |
parent | 95c60794f0b0122930b441df82eac8235e4e33ec (diff) | |
download | chromium_src-6934a70facaac1c8f400f0740a3e6fe9697bb4a8.zip chromium_src-6934a70facaac1c8f400f0740a3e6fe9697bb4a8.tar.gz chromium_src-6934a70facaac1c8f400f0740a3e6fe9697bb4a8.tar.bz2 |
Start creating the content::WebPage interface around TabContents. This is just the start of moving 4 very commonly used unix_hacker functions into CamelCase. I've added the interface with just these methods, it's not actually used yet.
The long term plan is that TabContentsWrapper would become TabContents, while TabContents will become WebPageImpl
BUG=98716
Review URL: http://codereview.chromium.org/8997020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115043 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
47 files changed, 137 insertions, 136 deletions
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index f09c305..7ebba34 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -948,8 +948,8 @@ void AeroPeekManager::ActivateTab(int tab_id) { // We don't have to update thumbnails now since TabStrip will call // ActiveTabChanged() when it actually activates this tab. TabContents* contents = GetTabContents(tab_id); - if (contents && contents->delegate()) - contents->delegate()->ActivateContents(contents); + if (contents && contents->GetDelegate()) + contents->GetDelegate()->ActivateContents(contents); } void AeroPeekManager::CloseTab(int tab_id) { @@ -957,8 +957,8 @@ void AeroPeekManager::CloseTab(int tab_id) { // TabStrip will call TabClosingAt() when it actually closes this tab. We // will delete the AeroPeekWindow object attached to this tab there. TabContents* contents = GetTabContents(tab_id); - if (contents && contents->delegate()) - contents->delegate()->CloseContents(contents); + if (contents && contents->GetDelegate()) + contents->GetDelegate()->CloseContents(contents); } void AeroPeekManager::GetContentInsets(gfx::Insets* insets) { diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index b3f14d2..7d5b022 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -285,21 +285,22 @@ void AutomationProvider::OnTabReposition( void AutomationProvider::OnForwardContextMenuCommandToChrome(int tab_handle, int command) { - if (tab_tracker_->ContainsHandle(tab_handle)) { - NavigationController* tab = tab_tracker_->GetResource(tab_handle); - if (!tab) { - NOTREACHED(); - return; - } + if (!tab_tracker_->ContainsHandle(tab_handle)) + return; - TabContents* tab_contents = tab->tab_contents(); - if (!tab_contents || !tab_contents->delegate()) { - NOTREACHED(); - return; - } + NavigationController* tab = tab_tracker_->GetResource(tab_handle); + if (!tab) { + NOTREACHED(); + return; + } - tab_contents->delegate()->ExecuteContextMenuCommand(command); + TabContents* tab_contents = tab->tab_contents(); + if (!tab_contents || !tab_contents->GetDelegate()) { + NOTREACHED(); + return; } + + tab_contents->GetDelegate()->ExecuteContextMenuCommand(command); } void AutomationProvider::ConnectExternalTab( diff --git a/chrome/browser/chromeos/login/web_page_view.cc b/chrome/browser/chromeos/login/web_page_view.cc index 81f386e..0826963 100644 --- a/chrome/browser/chromeos/login/web_page_view.cc +++ b/chrome/browser/chromeos/login/web_page_view.cc @@ -89,7 +89,7 @@ void WizardWebPageViewTabContents::DocumentLoadedInFrame( void WebPageDomView::SetTabContentsDelegate( TabContentsDelegate* delegate) { - dom_contents_->tab_contents()->set_delegate(delegate); + dom_contents_->tab_contents()->SetDelegate(delegate); } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc index 284af06..3fc4542 100644 --- a/chrome/browser/chromeos/login/webui_login_view.cc +++ b/chrome/browser/chromeos/login/webui_login_view.cc @@ -147,7 +147,7 @@ void WebUILoginView::Init(views::Widget* login_window) { webui_login_->SetVisible(true); TabContents* tab_contents = webui_login_->dom_contents()->tab_contents(); - tab_contents->set_delegate(this); + tab_contents->SetDelegate(this); tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this)); } diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index c60c1db..fcc2e2f 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -264,7 +264,7 @@ void DevToolsWindow::Show(DevToolsToggleAction action) { FindInspectedBrowserAndTabIndex(&inspected_browser, &inspected_tab_index)) { BrowserWindow* inspected_window = inspected_browser->window(); - tab_contents_->tab_contents()->set_delegate(this); + tab_contents_->tab_contents()->SetDelegate(this); inspected_window->UpdateDevTools(); tab_contents_->tab_contents()->view()->SetInitialFocus(); inspected_window->Show(); @@ -558,7 +558,7 @@ void DevToolsWindow::AddNewContents(TabContents* source, const gfx::Rect& initial_pos, bool user_gesture) { if (inspected_tab_) { - inspected_tab_->tab_contents()->delegate()->AddNewContents( + inspected_tab_->tab_contents()->GetDelegate()->AddNewContents( source, new_contents, disposition, initial_pos, user_gesture); } } @@ -681,8 +681,8 @@ void DevToolsWindow::SaveToFile(const std::string& suggested_file_name, } content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { - if (inspected_tab_ && inspected_tab_->tab_contents()->delegate()) { - return inspected_tab_->tab_contents()->delegate()-> + if (inspected_tab_ && inspected_tab_->tab_contents()->GetDelegate()) { + return inspected_tab_->tab_contents()->GetDelegate()-> GetJavaScriptDialogCreator(); } return TabContentsDelegate::GetJavaScriptDialogCreator(); diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 92401b8..af31082 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -132,7 +132,7 @@ ExtensionHost::ExtensionHost(const Extension* extension, host_contents_.reset(new TabContents( profile_, site_instance, MSG_ROUTING_NONE, NULL, NULL)); TabContentsObserver::Observe(host_contents_.get()); - host_contents_->set_delegate(this); + host_contents_->SetDelegate(this); host_contents_->set_view_type(host_type); // TODO(mpcomplete): This was lifted from PrefsTabHelper, but it might be diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 094e6b9..603df3d 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -180,7 +180,7 @@ bool ExternalTabContainer::Init(Profile* profile, if (!infobars_enabled) tab_contents_->infobar_tab_helper()->set_infobars_enabled(false); - tab_contents_->tab_contents()->set_delegate(this); + tab_contents_->tab_contents()->SetDelegate(this); tab_contents_->tab_contents()-> GetMutableRendererPrefs()->browser_handles_top_level_requests = diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc index 8564749..8bc32c2 100644 --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc @@ -99,8 +99,8 @@ void HistoryTabHelper::DidNavigateAnyFrame( // the TabContents' URL getter does. scoped_refptr<history::HistoryAddPageArgs> add_page_args( CreateHistoryAddPageArgs(tab_contents()->GetURL(), details, params)); - if (!tab_contents()->delegate() || - !tab_contents()->delegate()->ShouldAddNavigationToHistory( + if (!tab_contents()->GetDelegate() || + !tab_contents()->GetDelegate()->ShouldAddNavigationToHistory( *add_page_args, details.type)) return; diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc index 783644e..8b79e93 100644 --- a/chrome/browser/instant/instant_loader.cc +++ b/chrome/browser/instant/instant_loader.cc @@ -777,7 +777,7 @@ TabContentsWrapper* InstantLoader::ReleasePreviewContents( &preview_contents_->tab_contents()->controller())); #endif } - preview_contents_->tab_contents()->set_delegate(NULL); + preview_contents_->tab_contents()->SetDelegate(NULL); ready_ = false; } update_bounds_timer_.Stop(); @@ -987,7 +987,7 @@ void InstantLoader::ReplacePreviewContents(TabContentsWrapper* old_tc, // Cleanup the old preview contents. old_tc->constrained_window_tab_helper()->set_delegate(NULL); old_tc->core_tab_helper()->set_delegate(NULL); - old_tc->tab_contents()->set_delegate(NULL); + old_tc->tab_contents()->SetDelegate(NULL); #if defined(OS_MACOSX) registrar_.Remove( @@ -1011,7 +1011,7 @@ void InstantLoader::ReplacePreviewContents(TabContentsWrapper* old_tc, } void InstantLoader::SetupPreviewContents(TabContentsWrapper* tab_contents) { - preview_contents_->tab_contents()->set_delegate( + preview_contents_->tab_contents()->SetDelegate( preview_tab_contents_delegate_.get()); preview_contents_->blocked_content_tab_helper()->SetAllContentsBlocked(true); preview_contents_->constrained_window_tab_helper()->set_delegate( diff --git a/chrome/browser/instant/instant_unload_handler.cc b/chrome/browser/instant/instant_unload_handler.cc index d4e8e78..a999439 100644 --- a/chrome/browser/instant/instant_unload_handler.cc +++ b/chrome/browser/instant/instant_unload_handler.cc @@ -22,7 +22,7 @@ class InstantUnloadHandler::TabContentsDelegateImpl : handler_(handler), tab_contents_(tab_contents), index_(index) { - tab_contents->tab_contents()->set_delegate(this); + tab_contents->tab_contents()->SetDelegate(this); } ~TabContentsDelegateImpl() { @@ -31,7 +31,7 @@ class InstantUnloadHandler::TabContentsDelegateImpl // Releases ownership of the TabContentsWrapper to the caller. TabContentsWrapper* ReleaseTab() { TabContentsWrapper* tab = tab_contents_.release(); - tab->tab_contents()->set_delegate(NULL); + tab->tab_contents()->SetDelegate(NULL); return tab; } diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index d0ba053..77e504c 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -118,7 +118,7 @@ void BalloonHost::Init() { NULL, NULL)); tab_contents_->set_view_type(chrome::VIEW_TYPE_NOTIFICATION); - tab_contents_->set_delegate(this); + tab_contents_->SetDelegate(this); Observe(tab_contents_.get()); tab_contents_->controller().LoadURL( diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index d6e4ab4..ef5a632 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -287,7 +287,7 @@ void PrerenderContents::StartPrerendering( starting_page_id_); tab_contents_delegate_.reset(new TabContentsDelegateImpl(this)); - new_contents->set_delegate(tab_contents_delegate_.get()); + new_contents->SetDelegate(tab_contents_delegate_.get()); // Set the size of the prerender TabContents. prerender_contents_->tab_contents()->view()->SizeContents(tab_bounds.size()); @@ -650,7 +650,7 @@ void PrerenderContents::DestroyWhenUsingTooManyResources() { } TabContentsWrapper* PrerenderContents::ReleasePrerenderContents() { - prerender_contents_->tab_contents()->set_delegate(NULL); + prerender_contents_->tab_contents()->SetDelegate(NULL); render_view_host_observer_.reset(); TabContentsObserver::Observe(NULL); return prerender_contents_.release(); diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index 134a51b..3125e1e 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -109,7 +109,7 @@ class PrerenderManager::OnCloseTabContentsDeleter TabContentsWrapper* tab) : manager_(manager), tab_(tab) { - tab_->tab_contents()->set_delegate(this); + tab_->tab_contents()->SetDelegate(this); MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&OnCloseTabContentsDeleter::ScheduleTabContentsForDeletion, this->AsWeakPtr(), true), kDeleteWithExtremePrejudiceTimeMs); @@ -133,7 +133,7 @@ class PrerenderManager::OnCloseTabContentsDeleter static const int kDeleteWithExtremePrejudiceTimeMs = 3000; void ScheduleTabContentsForDeletion(bool timeout) { - tab_->tab_contents()->set_delegate(NULL); + tab_->tab_contents()->SetDelegate(NULL); manager_->ScheduleDeleteOldTabContents(tab_.release(), this); UMA_HISTOGRAM_BOOLEAN("Prerender.TabContentsDeleterTimeout", timeout); } diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index 5c7d56e..cadc4fe 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -303,7 +303,7 @@ void PrintPreviewTabController::OnNavEntryCommitted( SetInitiatorTabURLAndTitle(preview_tab); // Disabling the delegate will prevent all future navigation. - tab->tab_contents()->set_delegate(NULL); + tab->tab_contents()->SetDelegate(NULL); return; } diff --git a/chrome/browser/sidebar/sidebar_container.cc b/chrome/browser/sidebar/sidebar_container.cc index f9db3f3..c3b77a9 100644 --- a/chrome/browser/sidebar/sidebar_container.cc +++ b/chrome/browser/sidebar/sidebar_container.cc @@ -33,7 +33,7 @@ SidebarContainer::SidebarContainer(TabContents* tab, sidebar_contents_.reset( new TabContents(Profile::FromBrowserContext(tab->browser_context()), NULL, MSG_ROUTING_NONE, NULL, NULL)); - sidebar_contents_->set_delegate(this); + sidebar_contents_->SetDelegate(this); } SidebarContainer::~SidebarContainer() { diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc index b856729..c153edb 100644 --- a/chrome/browser/tab_contents/background_contents.cc +++ b/chrome/browser/tab_contents/background_contents.cc @@ -34,7 +34,7 @@ BackgroundContents::BackgroundContents(SiteInstance* site_instance, tab_contents_.reset(new TabContents( profile_, site_instance, routing_id, NULL, NULL)); tab_contents_->set_view_type(chrome::VIEW_TYPE_BACKGROUND_CONTENTS); - tab_contents_->set_delegate(this); + tab_contents_->SetDelegate(this); TabContentsObserver::Observe(tab_contents_.get()); // Close ourselves when the application is shutting down. diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index dd5ea04..2e3fa8a 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -1054,8 +1054,8 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { return source_tab_contents_->controller().CanGoForward(); case IDC_RELOAD: - return source_tab_contents_->delegate() && - source_tab_contents_->delegate()->CanReloadContents( + return source_tab_contents_->GetDelegate() && + source_tab_contents_->GetDelegate()->CanReloadContents( source_tab_contents_); case IDC_VIEW_SOURCE: @@ -1415,8 +1415,8 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { params_.link_url, params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, params_.frame_id, - source_tab_contents_->delegate() && - source_tab_contents_->delegate()->IsApplication() ? + source_tab_contents_->GetDelegate() && + source_tab_contents_->GetDelegate()->IsApplication() ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB, content::PAGE_TRANSITION_LINK); break; diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc index 3e5e6fe..e73314c 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -269,8 +269,8 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindowFromTabContents( params.frame_name); if (new_contents) { - if (tab_contents->delegate()) - tab_contents->delegate()->TabContentsCreated(new_contents); + if (tab_contents->GetDelegate()) + tab_contents->GetDelegate()->TabContentsCreated(new_contents); RetargetingDetails details; details.source_tab_contents = tab_contents; @@ -309,8 +309,8 @@ TabContents* RenderViewHostDelegateViewHelper::ShowCreatedWindow( RenderWidgetHostView* RenderViewHostDelegateViewHelper::ShowCreatedWidget( TabContents* tab_contents, int route_id, const gfx::Rect& initial_pos) { - if (tab_contents->delegate()) - tab_contents->delegate()->RenderWidgetShowing(); + if (tab_contents->GetDelegate()) + tab_contents->GetDelegate()->RenderWidgetShowing(); RenderWidgetHostView* widget_host_view = GetCreatedWidget(route_id); widget_host_view->InitAsPopup(tab_contents->GetRenderWidgetHostView(), @@ -322,8 +322,8 @@ RenderWidgetHostView* RenderViewHostDelegateViewHelper::ShowCreatedWidget( RenderWidgetHostView* RenderViewHostDelegateViewHelper::ShowCreatedFullscreenWidget( TabContents* tab_contents, int route_id) { - if (tab_contents->delegate()) - tab_contents->delegate()->RenderWidgetShowing(); + if (tab_contents->GetDelegate()) + tab_contents->GetDelegate()->RenderWidgetShowing(); RenderWidgetHostView* widget_host_view = GetCreatedWidget(route_id); widget_host_view->InitAsFullscreen(tab_contents->GetRenderWidgetHostView()); diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc index 1b2c5d6..d6b9162 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc @@ -36,8 +36,8 @@ namespace { // Called when the mouse leaves the widget. We notify our delegate. gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event, TabContents* tab_contents) { - if (tab_contents->delegate()) - tab_contents->delegate()->ContentsMouseEvent( + if (tab_contents->GetDelegate()) + tab_contents->GetDelegate()->ContentsMouseEvent( tab_contents, gfx::Point(event->x_root, event->y_root), false); return FALSE; } @@ -45,8 +45,8 @@ gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event, // Called when the mouse moves within the widget. We notify our delegate. gboolean OnMouseMove(GtkWidget* widget, GdkEventMotion* event, TabContents* tab_contents) { - if (tab_contents->delegate()) - tab_contents->delegate()->ContentsMouseEvent( + if (tab_contents->GetDelegate()) + tab_contents->GetDelegate()->ContentsMouseEvent( tab_contents, gfx::Point(event->x_root, event->y_root), true); return FALSE; } @@ -59,7 +59,7 @@ gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, return FALSE; } - TabContentsDelegate* delegate = tab_contents->delegate(); + TabContentsDelegate* delegate = tab_contents->GetDelegate(); if (!delegate) return FALSE; @@ -282,9 +282,9 @@ void TabContentsViewGtk::GotFocus() { // This is called when the renderer asks us to take focus back (i.e., it has // iterated past the last focusable element on the page). void TabContentsViewGtk::TakeFocus(bool reverse) { - if (!tab_contents_->delegate()) + if (!tab_contents_->GetDelegate()) return; - if (!tab_contents_->delegate()->TakeFocus(reverse)) { + if (!tab_contents_->GetDelegate()->TakeFocus(reverse)) { gtk_widget_child_focus(GTK_WIDGET(GetTopLevelNativeWindow()), reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD); } @@ -401,9 +401,9 @@ void TabContentsViewGtk::StartDragging(const WebDropData& drop_data, void TabContentsViewGtk::OnChildSizeRequest(GtkWidget* widget, GtkWidget* child, GtkRequisition* requisition) { - if (tab_contents_->delegate()) { + if (tab_contents_->GetDelegate()) { requisition->height += - tab_contents_->delegate()->GetExtraRenderViewHeight(); + tab_contents_->GetDelegate()->GetExtraRenderViewHeight(); } } @@ -412,8 +412,8 @@ void TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, int width = allocation->width; int height = allocation->height; // |delegate()| can be NULL here during browser teardown. - if (tab_contents_->delegate()) - height += tab_contents_->delegate()->GetExtraRenderViewHeight(); + if (tab_contents_->GetDelegate()) + height += tab_contents_->GetDelegate()->GetExtraRenderViewHeight(); gfx::Size size(width, height); requested_size_ = size; diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index 927af25..8b533b2 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -465,13 +465,13 @@ void TabContentsViewMac::CloseTab() { - (void)mouseEvent:(NSEvent *)theEvent { TabContents* tabContents = [self tabContents]; - if (tabContents && tabContents->delegate()) { + if (tabContents && tabContents->GetDelegate()) { NSPoint location = [NSEvent mouseLocation]; if ([theEvent type] == NSMouseMoved) - tabContents->delegate()->ContentsMouseEvent( + tabContents->GetDelegate()->ContentsMouseEvent( tabContents, gfx::Point(location.x, location.y), true); if ([theEvent type] == NSMouseExited) - tabContents->delegate()->ContentsMouseEvent( + tabContents->GetDelegate()->ContentsMouseEvent( tabContents, gfx::Point(location.x, location.y), false); } } diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 96b7c7b..158e3d1 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -783,7 +783,7 @@ bool TabStripModel::IsContextMenuCommandEnabled( std::vector<int> indices = GetIndicesForCommand(context_index); for (size_t i = 0; i < indices.size(); ++i) { TabContentsWrapper* tab = GetTabContentsAt(indices[i]); - if (tab && tab->tab_contents()->delegate()->CanReloadContents( + if (tab && tab->tab_contents()->GetDelegate()->CanReloadContents( tab->tab_contents())) { return true; } @@ -844,7 +844,7 @@ void TabStripModel::ExecuteContextMenuCommand( std::vector<int> indices = GetIndicesForCommand(context_index); for (size_t i = 0; i < indices.size(); ++i) { TabContentsWrapper* tab = GetTabContentsAt(indices[i]); - if (tab && tab->tab_contents()->delegate()->CanReloadContents( + if (tab && tab->tab_contents()->GetDelegate()->CanReloadContents( tab->tab_contents())) { tab->tab_contents()->controller().Reload(true); } diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 447d349..5f8fa5a 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -187,12 +187,12 @@ class TabStripModelTest : public ChromeRenderViewHostTestHarness { // Sets the id of the specified contents. void SetID(TabContents* contents, int id) { - GetIDAccessor()->SetProperty(contents->property_bag(), id); + GetIDAccessor()->SetProperty(contents->GetPropertyBag(), id); } // Returns the id of the specified contents. int GetID(TabContents* contents) { - return *GetIDAccessor()->GetProperty(contents->property_bag()); + return *GetIDAccessor()->GetProperty(contents->GetPropertyBag()); } // Returns the state of the given tab strip as a string. The state consists diff --git a/chrome/browser/ui/blocked_content/blocked_content_container.cc b/chrome/browser/ui/blocked_content/blocked_content_container.cc index 71beb90..e2f3aee 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_container.cc +++ b/chrome/browser/ui/blocked_content/blocked_content_container.cc @@ -50,7 +50,7 @@ void BlockedContentContainer::AddTabContents(TabContentsWrapper* tab_contents, blocked_contents_.push_back( BlockedContent(tab_contents, disposition, bounds, user_gesture)); - tab_contents->tab_contents()->set_delegate(this); + tab_contents->tab_contents()->SetDelegate(this); tab_contents->blocked_content_tab_helper()->set_delegate(this); // Since the new tab_contents will not be shown, call WasHidden to change // its status on both RenderViewHost and RenderView. @@ -68,7 +68,7 @@ void BlockedContentContainer::LaunchForContents( BlockedContent content(*i); blocked_contents_.erase(i); i = blocked_contents_.end(); - tab_contents->tab_contents()->set_delegate(NULL); + tab_contents->tab_contents()->SetDelegate(NULL); tab_contents->blocked_content_tab_helper()->set_delegate(NULL); // We needn't call WasRestored to change its status because the // TabContents::AddNewContents will do it. @@ -98,7 +98,7 @@ void BlockedContentContainer::Clear() { for (BlockedContents::iterator i(blocked_contents_.begin()); i != blocked_contents_.end(); ++i) { TabContentsWrapper* tab_contents = i->tab_contents; - tab_contents->tab_contents()->set_delegate(NULL); + tab_contents->tab_contents()->SetDelegate(NULL); tab_contents->blocked_content_tab_helper()->set_delegate(NULL); delete tab_contents; } @@ -127,7 +127,7 @@ void BlockedContentContainer::CloseContents(TabContents* source) { i != blocked_contents_.end(); ++i) { TabContentsWrapper* tab_contents = i->tab_contents; if (tab_contents->tab_contents() == source) { - tab_contents->tab_contents()->set_delegate(NULL); + tab_contents->tab_contents()->SetDelegate(NULL); tab_contents->blocked_content_tab_helper()->set_delegate(NULL); blocked_contents_.erase(i); delete tab_contents; diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 999a643..ed3bf6a 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -3719,7 +3719,7 @@ void Browser::OnStartDownload(TabContents* source, DownloadItem* download) { if (constrained != wrapper) { // Download in a constrained popup is shown in the tab that opened it. TabContents* constrained_tab = constrained->tab_contents(); - constrained_tab->delegate()->OnStartDownload(constrained_tab, download); + constrained_tab->GetDelegate()->OnStartDownload(constrained_tab, download); return; } @@ -5020,7 +5020,7 @@ Browser* Browser::GetOrCreateTabbedBrowser(Profile* profile) { void Browser::SetAsDelegate(TabContentsWrapper* tab, Browser* delegate) { // TabContents... - tab->tab_contents()->set_delegate(delegate); + tab->tab_contents()->SetDelegate(delegate); // ...and all the helpers. tab->blocked_content_tab_helper()->set_delegate(delegate); diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index 6c3c5ee..ef8aa25 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -383,7 +383,7 @@ static NSAppleEventDescriptor* valueToDescriptor(Value* value) { - (void)handlesCloseScriptCommand:(NSScriptCommand*)command { TabContents* contents = tabContents_->tab_contents(); - contents->delegate()->CloseContents(contents); + contents->GetDelegate()->CloseContents(contents); } - (void)handlesViewSourceScriptCommand:(NSScriptCommand*)command { diff --git a/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm b/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm index 2d5c3a7..426d959 100644 --- a/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm +++ b/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm @@ -98,12 +98,12 @@ ConstrainedHtmlDelegateMac::ConstrainedHtmlDelegateMac( TabContents* tab_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); tab_.reset(new TabContentsWrapper(tab_contents)); - tab_contents->set_delegate(this); + tab_contents->SetDelegate(this); // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI // can get a reference to |this|. ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( - tab_contents->property_bag(), this); + tab_contents->GetPropertyBag(), this); tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), content::Referrer(), diff --git a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm index 46e491e..694afe5f 100644 --- a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm +++ b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm @@ -291,12 +291,12 @@ void HtmlDialogWindowDelegateBridge::HandleKeyboardEvent( delegate_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); [[self window] setContentView:contentsWrapper_->tab_contents()->GetNativeView()]; - contentsWrapper_->tab_contents()->set_delegate(delegate_.get()); + contentsWrapper_->tab_contents()->SetDelegate(delegate_.get()); // This must be done before loading the page; see the comments in // HtmlDialogUI. HtmlDialogUI::GetPropertyAccessor().SetProperty( - contentsWrapper_->tab_contents()->property_bag(), delegate_.get()); + contentsWrapper_->tab_contents()->GetPropertyBag(), delegate_.get()); contentsWrapper_->tab_contents()->controller().LoadURL( delegate_->GetDialogContentURL(), diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm index 38aa4b3..6a37d8e 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm @@ -112,10 +112,10 @@ base::PropertyAccessor<OmniboxViewMacState>* GetStateAccessor() { // Accessors for storing and getting the state from the tab. void StoreStateToTab(TabContents* tab, const OmniboxViewMacState& state) { - GetStateAccessor()->SetProperty(tab->property_bag(), state); + GetStateAccessor()->SetProperty(tab->GetPropertyBag(), state); } const OmniboxViewMacState* GetStateFromTab(const TabContents* tab) { - return GetStateAccessor()->GetProperty(tab->property_bag()); + return GetStateAccessor()->GetProperty(tab->GetPropertyBag()); } // Helper to make converting url_parse ranges to NSRange easier to diff --git a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc index 132779f..50de533 100644 --- a/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_html_delegate_gtk.cc @@ -101,12 +101,12 @@ ConstrainedHtmlDelegateGtk::ConstrainedHtmlDelegateGtk( TabContents* tab_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); tab_.reset(new TabContentsWrapper(tab_contents)); - tab_contents->set_delegate(this); + tab_contents->SetDelegate(this); // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI // can get a reference to |this|. ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( - tab_contents->property_bag(), this); + tab_contents->GetPropertyBag(), this); tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), content::Referrer(), diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc index b443fa5..23adc0f 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc @@ -293,8 +293,8 @@ CreateWebApplicationShortcutsDialogGtk::CreateWebApplicationShortcutsDialogGtk( } void CreateWebApplicationShortcutsDialogGtk::OnCreatedShortcut() { - if (tab_contents_->tab_contents()->delegate()) - tab_contents_->tab_contents()->delegate()->ConvertContentsToApplication( + if (tab_contents_->tab_contents()->GetDelegate()) + tab_contents_->tab_contents()->GetDelegate()->ConvertContentsToApplication( tab_contents_->tab_contents()); } diff --git a/chrome/browser/ui/gtk/html_dialog_gtk.cc b/chrome/browser/ui/gtk/html_dialog_gtk.cc index fdd4796..44a06b7 100644 --- a/chrome/browser/ui/gtk/html_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/html_dialog_gtk.cc @@ -172,12 +172,12 @@ void HtmlDialogGtk::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { gfx::NativeWindow HtmlDialogGtk::InitDialog() { tab_.reset(new TabContentsWrapper( new TabContents(profile(), NULL, MSG_ROUTING_NONE, NULL, NULL))); - tab_->tab_contents()->set_delegate(this); + tab_->tab_contents()->SetDelegate(this); // This must be done before loading the page; see the comments in // HtmlDialogUI. HtmlDialogUI::GetPropertyAccessor().SetProperty( - tab_->tab_contents()->property_bag(), this); + tab_->tab_contents()->GetPropertyBag(), this); tab_->tab_contents()->controller().LoadURL( GetDialogContentURL(), diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc index b3295bc..853eebf 100644 --- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc +++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc @@ -466,7 +466,7 @@ void OmniboxViewGtk::SaveStateToTab(TabContents* tab) { // NOTE: GetStateForTabSwitch may affect GetSelection, so order is important. AutocompleteEditModel::State model_state = model_->GetStateForTabSwitch(); GetStateAccessor()->SetProperty( - tab->property_bag(), + tab->GetPropertyBag(), AutocompleteEditState(model_state, ViewState(GetSelection()))); } @@ -484,7 +484,7 @@ void OmniboxViewGtk::Update(const TabContents* contents) { selected_text_.clear(); RevertAll(); const AutocompleteEditState* state = - GetStateAccessor()->GetProperty(contents->property_bag()); + GetStateAccessor()->GetProperty(contents->GetPropertyBag()); if (state) { model_->RestoreState(state->model_state); diff --git a/chrome/browser/ui/gtk/tabs/drag_data.cc b/chrome/browser/ui/gtk/tabs/drag_data.cc index 7490fd7..3246b11 100644 --- a/chrome/browser/ui/gtk/tabs/drag_data.cc +++ b/chrome/browser/ui/gtk/tabs/drag_data.cc @@ -37,7 +37,7 @@ DraggedTabData::~DraggedTabData() { } void DraggedTabData::ResetDelegate() { - contents_->tab_contents()->set_delegate(original_delegate_); + contents_->tab_contents()->SetDelegate(original_delegate_); } DragData::DragData(std::vector<DraggedTabData> drag_data, int source_tab_index) diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc index edb4acc..971abb4 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc @@ -154,8 +154,8 @@ DraggedTabData DraggedTabControllerGtk::InitDraggedTabData(TabGtk* tab) { // collected/destroyed while the drag is in process, leading to // nasty crashes. TabContentsDelegate* original_delegate = - contents->tab_contents()->delegate(); - contents->tab_contents()->set_delegate(this); + contents->tab_contents()->GetDelegate(); + contents->tab_contents()->SetDelegate(this); DraggedTabData dragged_tab_data(tab, contents, original_delegate, source_model_index, pinned, mini); @@ -228,8 +228,8 @@ void DraggedTabControllerGtk::Observe( for (size_t i = 0; i < drag_data_->size(); ++i) { if (drag_data_->get(i)->contents_->tab_contents() == destroyed_contents) { // One of the tabs we're dragging has been destroyed. Cancel the drag. - if (destroyed_contents->delegate() == this) - destroyed_contents->set_delegate(NULL); + if (destroyed_contents->GetDelegate() == this) + destroyed_contents->SetDelegate(NULL); drag_data_->get(i)->contents_ = NULL; drag_data_->get(i)->original_delegate_ = NULL; EndDragImpl(TAB_DESTROYED); @@ -423,7 +423,7 @@ void DraggedTabControllerGtk::Attach(TabStripGtk* attached_tabstrip, // Remove ourselves as the delegate now that the dragged TabContents is // being inserted back into a Browser. for (size_t i = 0; i < drag_data_->size(); ++i) { - drag_data_->get(i)->contents_->tab_contents()->set_delegate(NULL); + drag_data_->get(i)->contents_->tab_contents()->SetDelegate(NULL); drag_data_->get(i)->original_delegate_ = NULL; } @@ -487,7 +487,7 @@ void DraggedTabControllerGtk::Detach() { // Detaching resets the delegate, but we still want to be the delegate. for (size_t i = 0; i < drag_data_->size(); ++i) - drag_data_->get(i)->contents_->tab_contents()->set_delegate(this); + drag_data_->get(i)->contents_->tab_contents()->SetDelegate(this); attached_tabstrip_ = NULL; } @@ -782,7 +782,7 @@ bool DraggedTabControllerGtk::CompleteDrag() { void DraggedTabControllerGtk::ResetDelegates() { for (size_t i = 0; i < drag_data_->size(); ++i) { if (drag_data_->get(i)->contents_ && - drag_data_->get(i)->contents_->tab_contents()->delegate() == this) { + drag_data_->get(i)->contents_->tab_contents()->GetDelegate() == this) { drag_data_->get(i)->ResetDelegate(); } } diff --git a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc index 5272d5c..212bae1 100644 --- a/chrome/browser/ui/gtk/web_intent_picker_gtk.cc +++ b/chrome/browser/ui/gtk/web_intent_picker_gtk.cc @@ -249,7 +249,7 @@ TabContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); inline_disposition_tab_contents_.reset(new TabContentsWrapper(tab_contents)); inline_disposition_delegate_.reset(new InlineDispositionDelegate); - tab_contents->set_delegate(inline_disposition_delegate_.get()); + tab_contents->SetDelegate(inline_disposition_delegate_.get()); tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index f5a26ef..9c20772 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -66,7 +66,7 @@ TabContentsWrapper::TabContentsWrapper(TabContents* contents) // Stash this in the property bag so it can be retrieved without having to // go to a Browser. - property_accessor()->SetProperty(contents->property_bag(), this); + property_accessor()->SetProperty(contents->GetPropertyBag(), this); // Create the tab helpers. autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); @@ -157,7 +157,7 @@ TabContentsWrapper* TabContentsWrapper::Clone() { TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents( TabContents* contents) { TabContentsWrapper** wrapper = - property_accessor()->GetProperty(contents->property_bag()); + property_accessor()->GetProperty(contents->GetPropertyBag()); return wrapper ? *wrapper : NULL; } @@ -166,7 +166,7 @@ TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents( const TabContentsWrapper* TabContentsWrapper::GetCurrentWrapperForContents( const TabContents* contents) { TabContentsWrapper* const* wrapper = - property_accessor()->GetProperty(contents->property_bag()); + property_accessor()->GetProperty(contents->GetPropertyBag()); return wrapper ? *wrapper : NULL; } diff --git a/chrome/browser/ui/views/aura/app_list_window.cc b/chrome/browser/ui/views/aura/app_list_window.cc index 036790e..d0de9d8 100644 --- a/chrome/browser/ui/views/aura/app_list_window.cc +++ b/chrome/browser/ui/views/aura/app_list_window.cc @@ -96,7 +96,7 @@ void AppListWindow::Init(const gfx::Rect& bounds) { TabContents* tab = contents_->dom_contents()->tab_contents(); tab_watcher_.reset(new TabFirstRenderWatcher(tab, this)); - tab->set_delegate(this); + tab->SetDelegate(this); contents_->LoadURL(GURL(chrome::kChromeUIAppListURL)); static_cast<AppListUI*>(tab->web_ui())->set_delegate(this); diff --git a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc index 3638b8c..ea6200d 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc @@ -98,11 +98,11 @@ ConstrainedHtmlDelegateGtk::ConstrainedHtmlDelegateGtk( TabContents* tab_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); html_tab_contents_.reset(new TabContentsWrapper(tab_contents)); - tab_contents->set_delegate(this); + tab_contents->SetDelegate(this); // Set |this| as a property so the ConstrainedHtmlUI can retrieve it. ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( - tab_contents->property_bag(), this); + tab_contents->GetPropertyBag(), this); tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), content::Referrer(), content::PAGE_TRANSITION_START_PAGE, diff --git a/chrome/browser/ui/views/constrained_html_delegate_views.cc b/chrome/browser/ui/views/constrained_html_delegate_views.cc index fbbd60c..c41dd95 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_views.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_views.cc @@ -110,11 +110,11 @@ ConstrainedHtmlDelegateViews::ConstrainedHtmlDelegateViews( TabContents* tab_contents = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL, NULL); html_tab_contents_.reset(new TabContentsWrapper(tab_contents)); - tab_contents->set_delegate(this); + tab_contents->SetDelegate(this); // Set |this| as a property so the ConstrainedHtmlUI can retrieve it. ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( - html_tab_contents_->tab_contents()->property_bag(), this); + html_tab_contents_->tab_contents()->GetPropertyBag(), this); tab_contents->controller().LoadURL(delegate->GetDialogContentURL(), content::Referrer(), content::PAGE_TRANSITION_START_PAGE, diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 1e4f4d0..43bf2e8 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -436,8 +436,8 @@ bool CreateUrlApplicationShortcutView::Accept() { return false; tab_contents_->extension_tab_helper()->SetAppIcon(shortcut_info_.favicon); - if (tab_contents_->tab_contents()->delegate()) { - tab_contents_->tab_contents()->delegate()->ConvertContentsToApplication( + if (tab_contents_->tab_contents()->GetDelegate()) { + tab_contents_->tab_contents()->GetDelegate()->ConvertContentsToApplication( tab_contents_->tab_contents()); } return true; diff --git a/chrome/browser/ui/views/html_dialog_view.cc b/chrome/browser/ui/views/html_dialog_view.cc index 7c5c5da..f77d8d9 100644 --- a/chrome/browser/ui/views/html_dialog_view.cc +++ b/chrome/browser/ui/views/html_dialog_view.cc @@ -250,12 +250,12 @@ void HtmlDialogView::InitDialog() { DOMView::Init(profile(), NULL); TabContents* tab_contents = dom_contents_->tab_contents(); - tab_contents->set_delegate(this); + tab_contents->SetDelegate(this); // Set the delegate. This must be done before loading the page. See // the comment above HtmlDialogUI in its header file for why. HtmlDialogUI::GetPropertyAccessor().SetProperty( - tab_contents->property_bag(), this); + tab_contents->GetPropertyBag(), this); tab_watcher_.reset(new TabFirstRenderWatcher(tab_contents, this)); DOMView::LoadURL(GetDialogContentURL()); diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index 117703b..903aaf1 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc @@ -346,7 +346,7 @@ void OmniboxViewViews::SaveStateToTab(TabContents* tab) { gfx::SelectionModel selection; textfield_->GetSelectionModel(&selection); GetStateAccessor()->SetProperty( - tab->property_bag(), + tab->GetPropertyBag(), AutocompleteEditState(model_state, ViewState(selection))); } @@ -365,7 +365,7 @@ void OmniboxViewViews::Update(const TabContents* contents) { if (contents) { RevertAll(); const AutocompleteEditState* state = - GetStateAccessor()->GetProperty(contents->property_bag()); + GetStateAccessor()->GetProperty(contents->GetPropertyBag()); if (state) { model_->RestoreState(state->model_state); diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc index 6ef5ae5..25bbd3d 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc @@ -554,7 +554,7 @@ void OmniboxViewWin::SaveStateToTab(TabContents* tab) { CHARRANGE selection; GetSelection(selection); - GetStateAccessor()->SetProperty(tab->property_bag(), + GetStateAccessor()->SetProperty(tab->GetPropertyBag(), AutocompleteEditState( model_state, State(selection, saved_selection_for_focus_change_))); @@ -587,7 +587,7 @@ void OmniboxViewWin::Update(const TabContents* tab_for_state_restoring) { RevertAll(); const AutocompleteEditState* state = GetStateAccessor()->GetProperty( - tab_for_state_restoring->property_bag()); + tab_for_state_restoring->GetPropertyBag()); if (state) { model_->RestoreState(state->model_state); diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc index 36f5071..25545a4 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc @@ -275,13 +275,13 @@ void TabContentsViewViews::UpdateDragCursor(WebDragOperation operation) { } void TabContentsViewViews::GotFocus() { - if (tab_contents_->delegate()) - tab_contents_->delegate()->TabContentsFocused(tab_contents_); + if (tab_contents_->GetDelegate()) + tab_contents_->GetDelegate()->TabContentsFocused(tab_contents_); } void TabContentsViewViews::TakeFocus(bool reverse) { - if (tab_contents_->delegate() && - !tab_contents_->delegate()->TakeFocus(reverse)) { + if (tab_contents_->GetDelegate() && + !tab_contents_->GetDelegate()->TakeFocus(reverse)) { views::FocusManager* focus_manager = GetFocusManager(); // We may not have a focus manager if the tab has been switched before this @@ -333,8 +333,8 @@ void TabContentsViewViews::ShowCreatedFullscreenWidget(int route_id) { void TabContentsViewViews::ShowContextMenu(const ContextMenuParams& params) { // Allow delegates to handle the context menu operation first. - if (tab_contents_->delegate() && - tab_contents_->delegate()->HandleContextMenu(params)) { + if (tab_contents_->GetDelegate() && + tab_contents_->GetDelegate()->HandleContextMenu(params)) { return; } @@ -394,21 +394,21 @@ void TabContentsViewViews::OnNativeTabContentsViewSized(const gfx::Size& size) { } void TabContentsViewViews::OnNativeTabContentsViewWheelZoom(bool zoom_in) { - if (tab_contents_->delegate()) - tab_contents_->delegate()->ContentsZoomChange(zoom_in); + if (tab_contents_->GetDelegate()) + tab_contents_->GetDelegate()->ContentsZoomChange(zoom_in); } void TabContentsViewViews::OnNativeTabContentsViewMouseDown() { // Make sure this TabContents is activated when it is clicked on. - if (tab_contents_->delegate()) - tab_contents_->delegate()->ActivateContents(tab_contents_); + if (tab_contents_->GetDelegate()) + tab_contents_->GetDelegate()->ActivateContents(tab_contents_); } void TabContentsViewViews::OnNativeTabContentsViewMouseMove(bool motion) { // Let our delegate know that the mouse moved (useful for resetting status // bubble state). - if (tab_contents_->delegate()) { - tab_contents_->delegate()->ContentsMouseEvent( + if (tab_contents_->GetDelegate()) { + tab_contents_->GetDelegate()->ContentsMouseEvent( tab_contents_, gfx::Screen::GetCursorScreenPoint(), motion); } } diff --git a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc index 22e4b5a..e414d06 100644 --- a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc @@ -385,8 +385,8 @@ void DefaultTabDragController::InitTabDragData(BaseTab* tab, // our dragged TabContents may be replaced and subsequently // collected/destroyed while the drag is in process, leading to nasty crashes. drag_data->original_delegate = - drag_data->contents->tab_contents()->delegate(); - drag_data->contents->tab_contents()->set_delegate(this); + drag_data->contents->tab_contents()->GetDelegate(); + drag_data->contents->tab_contents()->SetDelegate(this); } void DefaultTabDragController::Drag() { @@ -490,8 +490,8 @@ void DefaultTabDragController::Observe( for (size_t i = 0; i < drag_data_.size(); ++i) { if (drag_data_[i].contents->tab_contents() == destroyed_contents) { // One of the tabs we're dragging has been destroyed. Cancel the drag. - if (destroyed_contents->delegate() == this) - destroyed_contents->set_delegate(NULL); + if (destroyed_contents->GetDelegate() == this) + destroyed_contents->SetDelegate(NULL); drag_data_[i].contents = NULL; drag_data_[i].original_delegate = NULL; EndDragImpl(TAB_DESTROYED); @@ -836,7 +836,7 @@ void DefaultTabDragController::Attach(TabStrip* attached_tabstrip, // Remove ourselves as the delegate now that the dragged TabContents is // being inserted back into a Browser. for (size_t i = 0; i < drag_data_.size(); ++i) { - drag_data_[i].contents->tab_contents()->set_delegate(NULL); + drag_data_[i].contents->tab_contents()->SetDelegate(NULL); drag_data_[i].original_delegate = NULL; } @@ -919,7 +919,7 @@ void DefaultTabDragController::Detach() { attached_model->DetachTabContentsAt(index); // Detaching resets the delegate, but we still want to be the delegate. - drag_data_[i].contents->tab_contents()->set_delegate(this); + drag_data_[i].contents->tab_contents()->SetDelegate(this); // Detaching may end up deleting the tab, drop references to it. drag_data_[i].attached_tab = NULL; @@ -1268,8 +1268,8 @@ void DefaultTabDragController::CompleteDrag() { void DefaultTabDragController::ResetDelegates() { for (size_t i = 0; i < drag_data_.size(); ++i) { if (drag_data_[i].contents && - drag_data_[i].contents->tab_contents()->delegate() == this) { - drag_data_[i].contents->tab_contents()->set_delegate( + drag_data_[i].contents->tab_contents()->GetDelegate() == this) { + drag_data_[i].contents->tab_contents()->SetDelegate( drag_data_[i].original_delegate); } } diff --git a/chrome/browser/ui/webui/constrained_html_ui.cc b/chrome/browser/ui/webui/constrained_html_ui.cc index ee880a5..1c6515d 100644 --- a/chrome/browser/ui/webui/constrained_html_ui.cc +++ b/chrome/browser/ui/webui/constrained_html_ui.cc @@ -71,7 +71,7 @@ void ConstrainedHtmlUI::OnDialogCloseMessage(const ListValue* args) { ConstrainedHtmlUIDelegate* ConstrainedHtmlUI::GetConstrainedDelegate() { ConstrainedHtmlUIDelegate** property = - GetPropertyAccessor().GetProperty(tab_contents()->property_bag()); + GetPropertyAccessor().GetProperty(tab_contents()->GetPropertyBag()); return property ? *property : NULL; } diff --git a/chrome/browser/ui/webui/html_dialog_ui.cc b/chrome/browser/ui/webui/html_dialog_ui.cc index 4a35f0a..dce3f95 100644 --- a/chrome/browser/ui/webui/html_dialog_ui.cc +++ b/chrome/browser/ui/webui/html_dialog_ui.cc @@ -56,7 +56,7 @@ void HtmlDialogUI::RenderViewCreated(RenderViewHost* render_view_host) { std::string dialog_args; std::vector<WebUIMessageHandler*> handlers; HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty( - tab_contents()->property_bag()); + tab_contents()->GetPropertyBag()); if (delegate) { dialog_args = (*delegate)->GetDialogArgs(); (*delegate)->GetWebUIMessageHandlers(&handlers); @@ -80,7 +80,7 @@ void HtmlDialogUI::RenderViewCreated(RenderViewHost* render_view_host) { void HtmlDialogUI::OnDialogClosed(const ListValue* args) { HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty( - tab_contents()->property_bag()); + tab_contents()->GetPropertyBag()); if (delegate) { std::string json_retval; if (args && !args->empty() && !args->GetString(0, &json_retval)) |