diff options
Diffstat (limited to 'chrome/browser/ui')
| -rw-r--r-- | chrome/browser/ui/browser.cc | 10 | ||||
| -rw-r--r-- | chrome/browser/ui/browser.h | 2 | ||||
| -rw-r--r-- | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc | 12 | ||||
| -rw-r--r-- | chrome/browser/ui/panels/old_base_panel_browser_test.cc | 7 | ||||
| -rw-r--r-- | chrome/browser/ui/panels/old_panel_browsertest.cc | 9 | ||||
| -rw-r--r-- | chrome/browser/ui/pdf/pdf_browsertest.cc | 30 | ||||
| -rw-r--r-- | chrome/browser/ui/sync/browser_synced_window_delegate.cc | 2 | ||||
| -rw-r--r-- | chrome/browser/ui/tab_contents/core_tab_helper.cc | 2 | ||||
| -rw-r--r-- | chrome/browser/ui/tab_contents/tab_contents.cc | 12 | ||||
| -rw-r--r-- | chrome/browser/ui/tab_contents/tab_contents.h | 4 | ||||
| -rw-r--r-- | chrome/browser/ui/tab_contents/tab_contents_iterator.cc | 2 | ||||
| -rw-r--r-- | chrome/browser/ui/tab_contents/tab_contents_wrapper.h | 13 | ||||
| -rw-r--r-- | chrome/browser/ui/views/frame/browser_view.cc | 2 | ||||
| -rw-r--r-- | chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc | 27 | ||||
| -rw-r--r-- | chrome/browser/ui/zoom/zoom_controller.cc | 15 | ||||
| -rw-r--r-- | chrome/browser/ui/zoom/zoom_controller.h | 7 | ||||
| -rw-r--r-- | chrome/browser/ui/zoom/zoom_observer.h | 5 |
17 files changed, 58 insertions, 103 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 92ddcf00..280a418 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1061,11 +1061,6 @@ int Browser::GetIndexOfController( return tab_strip_model_->GetIndexOfController(controller); } -// DEPRECATED -TabContents* Browser::GetSelectedTabContentsWrapper() const { - return GetActiveTabContents(); -} - TabContents* Browser::GetActiveTabContents() const { return tab_strip_model_->GetActiveTabContents(); } @@ -1080,11 +1075,6 @@ WebContents* Browser::GetActiveWebContents() const { return tab_contents ? tab_contents->web_contents() : NULL; } -// DEPRECATED -TabContents* Browser::GetTabContentsWrapperAt(int index) const { - return GetTabContentsAt(index); -} - TabContents* Browser::GetTabContentsAt(int index) const { return tab_strip_model_->GetTabContentsAt(index); } diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 0ee3a9e..4348e05 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h @@ -401,13 +401,11 @@ class Browser : public TabStripModelDelegate, int GetIndexOfController( const content::NavigationController* controller) const; - TabContents* GetSelectedTabContentsWrapper() const; // DEPRECATED TabContents* GetActiveTabContents() const; // A convenient version of the above which returns the TabContents's // WebContents. content::WebContents* GetSelectedWebContents() const; // DEPRECATED content::WebContents* GetActiveWebContents() const; - TabContents* GetTabContentsWrapperAt(int index) const; // DEPRECATED TabContents* GetTabContentsAt(int index) const; // A convenient version of the above which returns the TabContents's // WebContents. diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc index b246942..1549013 100644 --- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc +++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc @@ -583,9 +583,9 @@ class OmniboxViewTest : public InProcessBrowserTest, ASSERT_TRUE(SendKeyAndWait(browser(), ui::VKEY_RETURN, ui::EF_CONTROL_DOWN, content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::Source<content::NavigationController>( - &browser()->GetSelectedWebContents()->GetController()))); + &browser()->GetActiveWebContents()->GetController()))); - GURL url = browser()->GetSelectedWebContents()->GetURL(); + GURL url = browser()->GetActiveWebContents()->GetURL(); EXPECT_STREQ(kDesiredTLDHostname, url.host().c_str()); } @@ -619,8 +619,8 @@ class OmniboxViewTest : public InProcessBrowserTest, ASSERT_TRUE(SendKeyAndWait(browser(), ui::VKEY_RETURN, 0, content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::Source<content::NavigationController>( - &browser()->GetSelectedWebContents()->GetController()))); - GURL url = browser()->GetSelectedWebContents()->GetURL(); + &browser()->GetActiveWebContents()->GetController()))); + GURL url = browser()->GetActiveWebContents()->GetURL(); EXPECT_STREQ(kSearchTextURL, url.spec().c_str()); // Test that entering a single character then Enter performs a search. @@ -639,8 +639,8 @@ class OmniboxViewTest : public InProcessBrowserTest, ASSERT_TRUE(SendKeyAndWait(browser(), ui::VKEY_RETURN, 0, content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::Source<content::NavigationController>( - &browser()->GetSelectedWebContents()->GetController()))); - url = browser()->GetSelectedWebContents()->GetURL(); + &browser()->GetActiveWebContents()->GetController()))); + url = browser()->GetActiveWebContents()->GetURL(); EXPECT_STREQ(kSearchSingleCharURL, url.spec().c_str()); } diff --git a/chrome/browser/ui/panels/old_base_panel_browser_test.cc b/chrome/browser/ui/panels/old_base_panel_browser_test.cc index 662878d..75c58f3 100644 --- a/chrome/browser/ui/panels/old_base_panel_browser_test.cc +++ b/chrome/browser/ui/panels/old_base_panel_browser_test.cc @@ -19,7 +19,7 @@ #include "chrome/browser/ui/panels/panel_browser_window.h" #include "chrome/browser/ui/panels/panel_manager.h" #include "chrome/browser/ui/panels/panel_mouse_watcher.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -398,9 +398,8 @@ Panel* OldBasePanelBrowserTest::CreateDetachedPanel(const std::string& name, } void OldBasePanelBrowserTest::CreateTestTabContents(Browser* browser) { - TabContentsWrapper* tab_contents = - new TabContentsWrapper( - WebContentsTester::CreateTestWebContents(browser->profile(), NULL)); + TabContents* tab_contents = new TabContents( + WebContentsTester::CreateTestWebContents(browser->profile(), NULL)); browser->AddTab(tab_contents, content::PAGE_TRANSITION_LINK); } diff --git a/chrome/browser/ui/panels/old_panel_browsertest.cc b/chrome/browser/ui/panels/old_panel_browsertest.cc index 024285e..48d2031 100644 --- a/chrome/browser/ui/panels/old_panel_browsertest.cc +++ b/chrome/browser/ui/panels/old_panel_browsertest.cc @@ -1409,12 +1409,11 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, EXPECT_EQ(2U, BrowserList::size()); // Swap tab contents over to the panel from the tabbed browser. - TabContentsWrapper* contents = - browser()->tab_strip_model()->DetachTabContentsAt(0); + TabContents* contents = browser()->tab_strip_model()->DetachTabContentsAt(0); panel_browser->tab_strip_model()->InsertTabContentsAt( 0, contents, TabStripModel::ADD_NONE); panel_browser->SelectNumberedTab(0); - EXPECT_EQ(contents, panel_browser->GetSelectedTabContentsWrapper()); + EXPECT_EQ(contents, panel_browser->GetActiveTabContents()); EXPECT_EQ(1, PanelManager::GetInstance()->num_panels()); // Ensure that the tab contents were noticed by the panel by @@ -1425,7 +1424,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, content::Source<Panel>(panel)); EXPECT_TRUE(ui_test_utils::ExecuteJavaScript( - panel_browser->GetSelectedWebContents()->GetRenderViewHost(), + panel_browser->GetActiveWebContents()->GetRenderViewHost(), std::wstring(), L"changeSize(50);")); enlarge.Wait(); @@ -1440,7 +1439,7 @@ IN_PROC_BROWSER_TEST_F(OldPanelBrowserTest, EXPECT_EQ(0, PanelManager::GetInstance()->num_panels()); Browser* tabbed_browser = browser::FindTabbedBrowser(profile, false); - EXPECT_EQ(contents, tabbed_browser->GetSelectedTabContentsWrapper()); + EXPECT_EQ(contents, tabbed_browser->GetActiveTabContents()); tabbed_browser->window()->Close(); } diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc index bbeed83..bcc5c95 100644 --- a/chrome/browser/ui/pdf/pdf_browsertest.cc +++ b/chrome/browser/ui/pdf/pdf_browsertest.cc @@ -10,7 +10,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/snapshot_tab_helper.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/in_process_browser_test.h" @@ -83,12 +83,12 @@ class PDFBrowserTest : public InProcessBrowserTest, void VerifySnapshot(const std::string& expected_filename) { snapshot_different_ = true; expected_filename_ = expected_filename; - TabContentsWrapper* wrapper = browser()->GetSelectedTabContentsWrapper(); - wrapper->snapshot_tab_helper()->CaptureSnapshot(); + TabContents* tab_contents = browser()->GetActiveTabContents(); + tab_contents->snapshot_tab_helper()->CaptureSnapshot(); ui_test_utils::RegisterAndWait( this, chrome::NOTIFICATION_TAB_SNAPSHOT_TAKEN, - content::Source<WebContents>(wrapper->web_contents())); + content::Source<WebContents>(tab_contents->web_contents())); ASSERT_FALSE(snapshot_different_) << "Rendering didn't match, see result " "at " << snapshot_filename_.value().c_str(); } @@ -107,7 +107,7 @@ class PDFBrowserTest : public InProcessBrowserTest, string16 query = UTF8ToUTF16( std::string("xyzxyz" + base::IntToString(next_dummy_search_value_++))); ASSERT_EQ(0, ui_test_utils::FindInPage( - browser()->GetSelectedTabContentsWrapper(), query, true, false, NULL)); + browser()->GetActiveTabContents(), query, true, false, NULL)); } private: @@ -237,13 +237,13 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Scroll) { wheel_event.type = WebKit::WebInputEvent::MouseWheel; wheel_event.deltaY = -200; wheel_event.wheelTicksY = -2; - WebContents* web_contents = browser()->GetSelectedWebContents(); + WebContents* web_contents = browser()->GetActiveWebContents(); web_contents->GetRenderViewHost()->ForwardWheelEvent(wheel_event); ASSERT_NO_FATAL_FAILURE(WaitForResponse()); int y_offset = 0; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt( - browser()->GetSelectedWebContents()->GetRenderViewHost(), + browser()->GetActiveWebContents()->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(plugin.pageYOffset())", &y_offset)); @@ -260,7 +260,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_FindAndCopy) { ASSERT_NO_FATAL_FAILURE(Load()); // Verifies that find in page works. ASSERT_EQ(3, ui_test_utils::FindInPage( - browser()->GetSelectedTabContentsWrapper(), UTF8ToUTF16("adipiscing"), + browser()->GetActiveTabContents(), UTF8ToUTF16("adipiscing"), true, false, NULL)); // Verify that copying selected text works. @@ -272,7 +272,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_FindAndCopy) { objects[ui::Clipboard::CBF_TEXT] = params; clipboard.WriteObjects(ui::Clipboard::BUFFER_STANDARD, objects); - browser()->GetSelectedWebContents()->GetRenderViewHost()->Copy(); + browser()->GetActiveWebContents()->GetRenderViewHost()->Copy(); ASSERT_NO_FATAL_FAILURE(WaitForResponse()); std::string text; @@ -288,7 +288,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, SLOW_Loading) { ASSERT_TRUE(pdf_test_server()->Start()); NavigationController* controller = - &(browser()->GetSelectedWebContents()->GetController()); + &(browser()->GetActiveWebContents()->GetController()); content::NotificationRegistrar registrar; registrar.Add(this, content::NOTIFICATION_LOAD_STOP, @@ -323,7 +323,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, SLOW_Loading) { // and before creating a byte-range request loader. bool complete = false; ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( - browser()->GetSelectedWebContents()->GetRenderViewHost(), + browser()->GetActiveWebContents()->GetRenderViewHost(), std::wstring(), L"window.domAutomationController.send(plugin.documentLoadComplete())", &complete)); @@ -334,7 +334,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, SLOW_Loading) { // nested message loop for the JS call. if (last_count != load_stop_notification_count()) continue; - ui_test_utils::WaitForLoadStop(browser()->GetSelectedWebContents()); + ui_test_utils::WaitForLoadStop(browser()->GetActiveWebContents()); } } } @@ -349,14 +349,14 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, DISABLED_OnLoadAndReload) { ui_test_utils::WindowedNotificationObserver observer( content::NOTIFICATION_LOAD_STOP, content::Source<NavigationController>( - &browser()->GetSelectedWebContents()->GetController())); + &browser()->GetActiveWebContents()->GetController())); ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( - browser()->GetSelectedWebContents()->GetRenderViewHost(), + browser()->GetActiveWebContents()->GetRenderViewHost(), std::wstring(), L"reloadPDF();")); observer.Wait(); - ASSERT_EQ("success", browser()->GetSelectedWebContents()->GetURL().query()); + ASSERT_EQ("success", browser()->GetActiveWebContents()->GetURL().query()); } } // namespace diff --git a/chrome/browser/ui/sync/browser_synced_window_delegate.cc b/chrome/browser/ui/sync/browser_synced_window_delegate.cc index 73abfe1..fcc34d9 100644 --- a/chrome/browser/ui/sync/browser_synced_window_delegate.cc +++ b/chrome/browser/ui/sync/browser_synced_window_delegate.cc @@ -11,7 +11,7 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" // static SyncedWindowDelegate implementations diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc index 5618f3d..6f8c9e14 100644 --- a/chrome/browser/ui/tab_contents/core_tab_helper.cc +++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/renderer_host/web_cache_manager.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" diff --git a/chrome/browser/ui/tab_contents/tab_contents.cc b/chrome/browser/ui/tab_contents/tab_contents.cc index b6dc733..5c0553f 100644 --- a/chrome/browser/ui/tab_contents/tab_contents.cc +++ b/chrome/browser/ui/tab_contents/tab_contents.cc @@ -208,18 +208,6 @@ TabContents* TabContents::Clone() { return new_tab_contents; } -// static deprecated -TabContents* TabContents::GetCurrentWrapperForContents( - WebContents* contents) { - return FromWebContents(contents); -} - -// static deprecated -const TabContents* TabContents::GetCurrentWrapperForContents( - const WebContents* contents) { - return FromWebContents(contents); -} - // static TabContents* TabContents::FromWebContents(WebContents* contents) { TabContents** tab_contents = diff --git a/chrome/browser/ui/tab_contents/tab_contents.h b/chrome/browser/ui/tab_contents/tab_contents.h index 0406ae9e..458e40a 100644 --- a/chrome/browser/ui/tab_contents/tab_contents.h +++ b/chrome/browser/ui/tab_contents/tab_contents.h @@ -104,10 +104,6 @@ class TabContents : public content::WebContentsObserver { // like callbacks from content/ where only a WebContents is available. In the // general case, please do NOT use this; plumb TabContents through the chrome/ // code instead of WebContents. - static TabContents* GetCurrentWrapperForContents( - content::WebContents* contents); // DEPRECATED - static const TabContents* GetCurrentWrapperForContents( - const content::WebContents* contents); // DEPRECATED static TabContents* FromWebContents(content::WebContents* contents); static const TabContents* FromWebContents( const content::WebContents* contents); diff --git a/chrome/browser/ui/tab_contents/tab_contents_iterator.cc b/chrome/browser/ui/tab_contents/tab_contents_iterator.cc index caa90fc..8d9de65 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_iterator.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_iterator.cc @@ -41,7 +41,7 @@ void TabContentsIterator::Advance() { } TabContents* next_tab = - (*browser_iterator_)->GetTabContentsWrapperAt(web_view_index_); + (*browser_iterator_)->GetTabContentsAt(web_view_index_); if (next_tab) { cur_ = next_tab; return; diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h deleted file mode 100644 index bdbc376..0000000 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ -#define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ -#pragma once - -#include "chrome/browser/ui/tab_contents/tab_contents.h" - -typedef TabContents TabContentsWrapper; - -#endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index e840de3..3401bd4 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -1958,7 +1958,7 @@ bool BrowserView::MaybeShowInfoBar(TabContents* contents) { void BrowserView::UpdateDevToolsForContents(TabContents* tab_contents) { WebContents* devtools_contents = NULL; if (tab_contents) { - TabContentsWrapper* devtools_tab_contents = + TabContents* devtools_tab_contents = DevToolsWindow::GetDevToolsContents(tab_contents->web_contents()); if (devtools_tab_contents) devtools_contents = devtools_tab_contents->web_contents(); diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc index f7b4a23..10e43b9 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc +++ b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc @@ -7,7 +7,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/constrained_window_tab_helper.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/webui/test_web_dialog_delegate.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/in_process_browser_test.h" @@ -48,8 +48,9 @@ class ConstrainedWebDialogBrowserTest : public InProcessBrowserTest { ConstrainedWebDialogBrowserTest() {} protected: - size_t GetConstrainedWindowCount(TabContentsWrapper* wrapper) const { - return wrapper->constrained_window_tab_helper()->constrained_window_count(); + size_t GetConstrainedWindowCount(TabContents* tab_contents) const { + return tab_contents-> + constrained_window_tab_helper()->constrained_window_count(); } }; @@ -58,17 +59,17 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, BasicTest) { // The delegate deletes itself. WebDialogDelegate* delegate = new test::TestWebDialogDelegate( GURL(chrome::kChromeUIConstrainedHTMLTestURL)); - TabContentsWrapper* wrapper = browser()->GetSelectedTabContentsWrapper(); - ASSERT_TRUE(wrapper); + TabContents* tab_contents = browser()->GetActiveTabContents(); + ASSERT_TRUE(tab_contents); ConstrainedWebDialogDelegate* dialog_delegate = ui::CreateConstrainedWebDialog(browser()->profile(), delegate, NULL, - wrapper); + tab_contents); ASSERT_TRUE(dialog_delegate); EXPECT_TRUE(dialog_delegate->window()); - EXPECT_EQ(1U, GetConstrainedWindowCount(wrapper)); + EXPECT_EQ(1U, GetConstrainedWindowCount(tab_contents)); } // Tests that ReleaseTabContentsOnDialogClose() works. @@ -77,25 +78,25 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, // The delegate deletes itself. WebDialogDelegate* delegate = new test::TestWebDialogDelegate( GURL(chrome::kChromeUIConstrainedHTMLTestURL)); - TabContentsWrapper* wrapper = browser()->GetSelectedTabContentsWrapper(); - ASSERT_TRUE(wrapper); + TabContents* tab_contents = browser()->GetActiveTabContents(); + ASSERT_TRUE(tab_contents); ConstrainedWebDialogDelegate* dialog_delegate = ui::CreateConstrainedWebDialog(browser()->profile(), delegate, NULL, - wrapper); + tab_contents); ASSERT_TRUE(dialog_delegate); - scoped_ptr<TabContentsWrapper> new_tab(dialog_delegate->tab()); + scoped_ptr<TabContents> new_tab(dialog_delegate->tab()); ASSERT_TRUE(new_tab.get()); - ASSERT_EQ(1U, GetConstrainedWindowCount(wrapper)); + ASSERT_EQ(1U, GetConstrainedWindowCount(tab_contents)); ConstrainedWebDialogBrowserTestObserver observer(new_tab->web_contents()); dialog_delegate->ReleaseTabContentsOnDialogClose(); dialog_delegate->OnDialogCloseFromWebUI(); ASSERT_FALSE(observer.tab_destroyed()); - EXPECT_EQ(0U, GetConstrainedWindowCount(wrapper)); + EXPECT_EQ(0U, GetConstrainedWindowCount(tab_contents)); new_tab.reset(); EXPECT_TRUE(observer.tab_destroyed()); } diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc index 090f616..acd3d38 100644 --- a/chrome/browser/ui/zoom/zoom_controller.cc +++ b/chrome/browser/ui/zoom/zoom_controller.cc @@ -6,7 +6,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_finder.h" -#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/public/browser/notification_types.h" @@ -15,11 +15,11 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/page_zoom.h" -ZoomController::ZoomController(TabContentsWrapper* tab_contents) +ZoomController::ZoomController(TabContents* tab_contents) : content::WebContentsObserver(tab_contents->web_contents()), zoom_icon_state_(NONE), zoom_percent_(100), - tab_contents_wrapper_(tab_contents), + tab_contents_(tab_contents), observer_(NULL) { default_zoom_level_.Init(prefs::kDefaultZoomLevel, tab_contents->profile()->GetPrefs(), this); @@ -60,8 +60,7 @@ void ZoomController::Observe(int type, } void ZoomController::UpdateState() { - double current_zoom_level = - tab_contents_wrapper_->web_contents()->GetZoomLevel(); + double current_zoom_level = tab_contents_->web_contents()->GetZoomLevel(); double default_zoom_level = default_zoom_level_.GetValue(); ZoomIconState state; @@ -73,19 +72,19 @@ void ZoomController::UpdateState() { state = ZOOM_MINUS_ICON; bool dummy; - int zoom_percent = tab_contents_wrapper_->web_contents()-> + int zoom_percent = tab_contents_->web_contents()-> GetZoomPercent(&dummy, &dummy); if (state != zoom_icon_state_) { zoom_icon_state_ = state; if (observer_) - observer_->OnZoomIconChanged(tab_contents_wrapper_, state); + observer_->OnZoomIconChanged(tab_contents_, state); } if (zoom_percent != zoom_percent_) { zoom_percent_ = zoom_percent; if (observer_) - observer_->OnZoomChanged(tab_contents_wrapper_, + observer_->OnZoomChanged(tab_contents_, zoom_percent, state != NONE); } diff --git a/chrome/browser/ui/zoom/zoom_controller.h b/chrome/browser/ui/zoom/zoom_controller.h index 7f887c6..8f27683 100644 --- a/chrome/browser/ui/zoom/zoom_controller.h +++ b/chrome/browser/ui/zoom/zoom_controller.h @@ -14,7 +14,6 @@ #include "content/public/browser/web_contents_observer.h" class TabContents; -typedef TabContents TabContentsWrapper; class ZoomObserver; // Per-tab class to manage the Omnibox zoom icon. @@ -27,7 +26,7 @@ class ZoomController : public content::NotificationObserver, ZOOM_MINUS_ICON, }; - explicit ZoomController(TabContentsWrapper* tab_contents); + explicit ZoomController(TabContents* tab_contents); virtual ~ZoomController(); ZoomIconState zoom_icon_state() const { return zoom_icon_state_; } @@ -61,8 +60,8 @@ class ZoomController : public content::NotificationObserver, // Used to access the default zoom level preference. DoublePrefMember default_zoom_level_; - // TabContentsWrapper that owns this instance. - TabContentsWrapper* tab_contents_wrapper_; + // TabContents that owns this instance. + TabContents* tab_contents_; // Observer receiving notifications on state changes. ZoomObserver* observer_; diff --git a/chrome/browser/ui/zoom/zoom_observer.h b/chrome/browser/ui/zoom/zoom_observer.h index 4baeede..74c8cc4 100644 --- a/chrome/browser/ui/zoom/zoom_observer.h +++ b/chrome/browser/ui/zoom/zoom_observer.h @@ -9,17 +9,16 @@ #include "chrome/browser/ui/zoom/zoom_controller.h" class TabContents; -typedef TabContents TabContentsWrapper; // Interface for objects that wish to be notified of changes in ZoomController. class ZoomObserver { public: // Notification that the Omnibox zoom icon should change. - virtual void OnZoomIconChanged(TabContentsWrapper* source, + virtual void OnZoomIconChanged(TabContents* source, ZoomController::ZoomIconState state) = 0; // Notification that the zoom percentage has changed. - virtual void OnZoomChanged(TabContentsWrapper* source, + virtual void OnZoomChanged(TabContents* source, int zoom_percent, bool can_show_bubble) = 0; |
