diff options
Diffstat (limited to 'chrome/browser/tab_contents')
13 files changed, 112 insertions, 112 deletions
diff --git a/chrome/browser/tab_contents/infobar_delegate.h b/chrome/browser/tab_contents/infobar_delegate.h index 271ec00..f4dc667 100644 --- a/chrome/browser/tab_contents/infobar_delegate.h +++ b/chrome/browser/tab_contents/infobar_delegate.h @@ -36,7 +36,7 @@ class LinkInfoBarDelegate; // and the delegate is free to clean itself up or reset state, which may have // fatal consequences for the InfoBar that was in the process of opening (or is // now fully opened) -- it is referencing a delegate that may not even exist -// anymore. +// anymore. // As such, it is generally much safer to dedicate a delegate instance to // AddInfoBar! class InfoBarDelegate { @@ -149,7 +149,7 @@ class LinkInfoBarDelegate : public InfoBarDelegate { // closed now or false if it should remain until the user explicitly closes // it. virtual bool LinkClicked(WindowOpenDisposition disposition) { - return true; + return true; } // Overridden from InfoBarDelegate: diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index e0ebd23..857068f 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -359,7 +359,7 @@ void InterstitialPage::DidNavigate( // The RenderViewHost has loaded its contents, we can show it now. render_view_host_->view()->Show(); - tab_->set_interstitial_page(this); + tab_->set_interstitial_page(this); // Notify the tab we are not loading so the throbber is stopped. It also // causes a NOTIFY_LOAD_STOP notification, that the AutomationProvider (used @@ -409,7 +409,7 @@ void InterstitialPage::Disable() { void InterstitialPage::TakeActionOnResourceDispatcher( ResourceRequestAction action) { - DCHECK(MessageLoop::current() == ui_loop_) << + DCHECK(MessageLoop::current() == ui_loop_) << "TakeActionOnResourceDispatcher should be called on the main thread."; if (action == CANCEL || action == RESUME) { diff --git a/chrome/browser/tab_contents/interstitial_page.h b/chrome/browser/tab_contents/interstitial_page.h index d05d0aa..b77d525 100644 --- a/chrome/browser/tab_contents/interstitial_page.h +++ b/chrome/browser/tab_contents/interstitial_page.h @@ -185,4 +185,4 @@ class InterstitialPage : public NotificationObserver, }; #endif // #ifndef CHROME_BROWSER_TAB_CONTENTS_INTERSTITIAL_PAGE_H_ - + diff --git a/chrome/browser/tab_contents/render_view_context_menu_controller.cc b/chrome/browser/tab_contents/render_view_context_menu_controller.cc index 4afcc86..88ca046 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_controller.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_controller.cc @@ -220,7 +220,7 @@ bool RenderViewContextMenuController::IsItemChecked(int id) const { // Check box for 'Check the Spelling of this field'. if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD) return params_.spellcheck_enabled; - + // Don't bother getting the display language vector if this isn't a spellcheck // language. if ((id < IDC_SPELLCHECK_LANGUAGES_FIRST) || @@ -272,7 +272,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { if (id >= IDC_SPELLCHECK_LANGUAGES_FIRST && id < IDC_SPELLCHECK_LANGUAGES_LAST) { const size_t language_number = id - IDC_SPELLCHECK_LANGUAGES_FIRST; - SpellChecker::Languages display_languages; + SpellChecker::Languages display_languages; SpellChecker::GetSpellCheckLanguagesToDisplayInContextMenu( source_web_contents_->profile(), &display_languages); if (language_number < display_languages.size()) { @@ -281,7 +281,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { source_web_contents_->profile()->GetPrefs(), NULL); dictionary_language.SetValue(display_languages[language_number]); } - + return; } @@ -363,7 +363,7 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { source_web_contents_->profile(), nav_entry, source_web_contents_->GetContentNativeView(), - PageInfoWindow::SECURITY); + PageInfoWindow::SECURITY); break; } diff --git a/chrome/browser/tab_contents/render_view_host_manager.cc b/chrome/browser/tab_contents/render_view_host_manager.cc index b1062bc..1b7b6a5 100644 --- a/chrome/browser/tab_contents/render_view_host_manager.cc +++ b/chrome/browser/tab_contents/render_view_host_manager.cc @@ -148,7 +148,7 @@ bool RenderViewHostManager::ShouldCloseTabOnUnresponsiveRenderer() { // handler later finishes, this call will be ignored because the state in // CrossSiteResourceHandler will already be cleaned up.) current_host()->process()->CrossSiteClosePageACK( - pending_render_view_host_->site_instance()->process_host_id(), + pending_render_view_host_->site_instance()->process_host_id(), pending_request_id); } return false; @@ -194,7 +194,7 @@ void RenderViewHostManager::OnCrossSiteResponse(int new_render_process_host_id, // means it is not a download or unsafe page, and we are going to perform the // navigation. Thus, we no longer need to remember that the RenderViewHost // is part of a pending cross-site request. - pending_render_view_host_->SetHasPendingCrossSiteRequest(false, + pending_render_view_host_->SetHasPendingCrossSiteRequest(false, new_request_id); } diff --git a/chrome/browser/tab_contents/repost_form_warning.h b/chrome/browser/tab_contents/repost_form_warning.h index 33588dc..9bbbbaa 100644 --- a/chrome/browser/tab_contents/repost_form_warning.h +++ b/chrome/browser/tab_contents/repost_form_warning.h @@ -1,17 +1,17 @@ -// Copyright (c) 2009 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_TAB_CONTENTS_REPOST_FORM_WARNING_H_
-#define CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_
-
-class NavigationController;
-
-// Runs the form repost warning dialog. If the user accepts the action, then
-// it will call Reload on the navigation controller back with check_for_repost
-// set to false.
-//
-// This function is implemented by the platform-specific frontend.
-void RunRepostFormWarningDialog(NavigationController* nav_controller);
-
-#endif // CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_
+// Copyright (c) 2009 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_TAB_CONTENTS_REPOST_FORM_WARNING_H_ +#define CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_ + +class NavigationController; + +// Runs the form repost warning dialog. If the user accepts the action, then +// it will call Reload on the navigation controller back with check_for_repost +// set to false. +// +// This function is implemented by the platform-specific frontend. +void RunRepostFormWarningDialog(NavigationController* nav_controller); + +#endif // CHROME_BROWSER_TAB_CONTENTS_REPOST_FORM_WARNING_H_ diff --git a/chrome/browser/tab_contents/site_instance.h b/chrome/browser/tab_contents/site_instance.h index 141f61c..6e25a2b 100644 --- a/chrome/browser/tab_contents/site_instance.h +++ b/chrome/browser/tab_contents/site_instance.h @@ -109,7 +109,7 @@ class SiteInstance : public base::RefCounted<SiteInstance> { // this SiteInstance becomes ref counted, by storing it in a scoped_refptr. // // The render process host factory may be NULL. See SiteInstance constructor. - // + // // TODO(creis): This may be an argument to build a pass_refptr<T> class, as // Darin suggests. static SiteInstance* CreateSiteInstance(Profile* profile); diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 1df337c..56db088 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -159,7 +159,7 @@ const string16& TabContents::GetTitle() const { NavigationEntry* entry = controller_->GetTransientEntry(); if (entry) return entry->GetTitleForDisplay(controller_); - + entry = controller_->GetLastCommittedEntry(); if (entry) return entry->GetTitleForDisplay(controller_); @@ -597,7 +597,7 @@ void TabContents::SetIsLoading(bool is_loading, NotificationDetails det = details ? Details<LoadNotificationDetails>(details) : NotificationService::NoDetails(); - NotificationService::current()->Notify(type, + NotificationService::current()->Notify(type, Source<NavigationController>(this->controller()), det); } diff --git a/chrome/browser/tab_contents/test_web_contents.cc b/chrome/browser/tab_contents/test_web_contents.cc index 866e28a..2977423 100644 --- a/chrome/browser/tab_contents/test_web_contents.cc +++ b/chrome/browser/tab_contents/test_web_contents.cc @@ -1,18 +1,18 @@ -// Copyright (c) 2009 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.
-
-#include "chrome/browser/tab_contents/test_web_contents.h"
-
-#include "chrome/browser/renderer_host/test_render_view_host.h"
-
-TestWebContents::TestWebContents(Profile* profile, SiteInstance* instance,
- RenderViewHostFactory* rvh_factory)
- : WebContents(profile, instance, rvh_factory, MSG_ROUTING_NONE, NULL),
- transition_cross_site(false) {
-}
-
-TestRenderViewHost* TestWebContents::pending_rvh() {
- return static_cast<TestRenderViewHost*>(
- render_manager_.pending_render_view_host_);
-}
+// Copyright (c) 2009 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. + +#include "chrome/browser/tab_contents/test_web_contents.h" + +#include "chrome/browser/renderer_host/test_render_view_host.h" + +TestWebContents::TestWebContents(Profile* profile, SiteInstance* instance, + RenderViewHostFactory* rvh_factory) + : WebContents(profile, instance, rvh_factory, MSG_ROUTING_NONE, NULL), + transition_cross_site(false) { +} + +TestRenderViewHost* TestWebContents::pending_rvh() { + return static_cast<TestRenderViewHost*>( + render_manager_.pending_render_view_host_); +} diff --git a/chrome/browser/tab_contents/test_web_contents.h b/chrome/browser/tab_contents/test_web_contents.h index ba7fa33..42ba35e 100644 --- a/chrome/browser/tab_contents/test_web_contents.h +++ b/chrome/browser/tab_contents/test_web_contents.h @@ -1,55 +1,55 @@ -// Copyright (c) 2009 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_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
-#define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
-
-#include "chrome/browser/tab_contents/web_contents.h"
-
-class RenderViewHostFactory;
-class TestRenderViewHost;
-
-// Subclass WebContents to ensure it creates TestRenderViewHosts and does
-// not do anything involving views.
-class TestWebContents : public WebContents {
- public:
- // The render view host factory will be passed on to the
- TestWebContents(Profile* profile, SiteInstance* instance,
- RenderViewHostFactory* rvh_factory);
-
- TestRenderViewHost* pending_rvh();
-
- // State accessor.
- bool cross_navigation_pending() {
- return render_manager_.cross_navigation_pending_;
- }
-
- // Overrides WebContents::ShouldTransitionCrossSite so that we can test both
- // alternatives without using command-line switches.
- bool ShouldTransitionCrossSite() { return transition_cross_site; }
-
- // Promote DidNavigate to public.
- void TestDidNavigate(RenderViewHost* render_view_host,
- const ViewHostMsg_FrameNavigate_Params& params) {
- DidNavigate(render_view_host, params);
- }
-
- // Promote GetWebkitPrefs to public.
- WebPreferences TestGetWebkitPrefs() {
- return GetWebkitPrefs();
- }
-
- // Prevent interaction with views.
- bool CreateRenderViewForRenderManager(RenderViewHost* render_view_host) {
- // This will go to a TestRenderViewHost.
- render_view_host->CreateRenderView();
- return true;
- }
- void UpdateRenderViewSizeForRenderManager() {}
-
- // Set by individual tests.
- bool transition_cross_site;
-};
-
-#endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_
+// Copyright (c) 2009 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_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ +#define CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ + +#include "chrome/browser/tab_contents/web_contents.h" + +class RenderViewHostFactory; +class TestRenderViewHost; + +// Subclass WebContents to ensure it creates TestRenderViewHosts and does +// not do anything involving views. +class TestWebContents : public WebContents { + public: + // The render view host factory will be passed on to the + TestWebContents(Profile* profile, SiteInstance* instance, + RenderViewHostFactory* rvh_factory); + + TestRenderViewHost* pending_rvh(); + + // State accessor. + bool cross_navigation_pending() { + return render_manager_.cross_navigation_pending_; + } + + // Overrides WebContents::ShouldTransitionCrossSite so that we can test both + // alternatives without using command-line switches. + bool ShouldTransitionCrossSite() { return transition_cross_site; } + + // Promote DidNavigate to public. + void TestDidNavigate(RenderViewHost* render_view_host, + const ViewHostMsg_FrameNavigate_Params& params) { + DidNavigate(render_view_host, params); + } + + // Promote GetWebkitPrefs to public. + WebPreferences TestGetWebkitPrefs() { + return GetWebkitPrefs(); + } + + // Prevent interaction with views. + bool CreateRenderViewForRenderManager(RenderViewHost* render_view_host) { + // This will go to a TestRenderViewHost. + render_view_host->CreateRenderView(); + return true; + } + void UpdateRenderViewSizeForRenderManager() {} + + // Set by individual tests. + bool transition_cross_site; +}; + +#endif // CHROME_BROWSER_TAB_CONTENTS_TEST_WEB_CONTENTS_H_ diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index dd2820b..6ca0726 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -1468,7 +1468,7 @@ WebContents::GetLastCommittedNavigationEntryForRenderManager() { return NULL; return controller()->GetLastCommittedEntry(); } - + bool WebContents::CreateRenderViewForRenderManager( RenderViewHost* render_view_host) { RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host); diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index a25c589..134b43a 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -149,7 +149,7 @@ class TestInterstitialPage : public InterstitialPage { SiteInstance::CreateSiteInstance(tab()->profile()), this, MSG_ROUTING_NONE, NULL); } - + virtual void CommandReceived(const std::string& command) { command_received_count_++; } @@ -973,10 +973,10 @@ TEST_F(WebContentsTest, ShowInterstitialOnInterstitial) { // Showing interstitial2 should have caused interstitial1 to go away. EXPECT_TRUE(deleted1); EXPECT_EQ(TestInterstitialPage::CANCELED, state1); - + // Let's make sure interstitial2 is working as intended. ASSERT_FALSE(deleted2); - EXPECT_EQ(TestInterstitialPage::UNDECIDED, state2); + EXPECT_EQ(TestInterstitialPage::UNDECIDED, state2); interstitial2->Proceed(); GURL landing_url("http://www.thepage.com"); rvh()->SendNavigate(2, landing_url); diff --git a/chrome/browser/tab_contents/web_contents_view_mac.mm b/chrome/browser/tab_contents/web_contents_view_mac.mm index a382bca..acdf717 100644 --- a/chrome/browser/tab_contents/web_contents_view_mac.mm +++ b/chrome/browser/tab_contents/web_contents_view_mac.mm @@ -47,14 +47,14 @@ RenderWidgetHostView* WebContentsViewMac::CreateViewForWidget( DCHECK(!render_widget_host->view()); RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(render_widget_host); - + // Fancy layout comes later; for now just make it our size and resize it // with us. NSView* view_view = view->native_view(); [cocoa_view_.get() addSubview:view_view]; [view_view setFrame:[cocoa_view_.get() bounds]]; [view_view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - + return view; } @@ -107,7 +107,7 @@ void WebContentsViewMac::ForwardMessageToDevToolsClient( const IPC::Message& message) { NOTIMPLEMENTED(); } - + void WebContentsViewMac::FindInPage(const Browser& browser, bool find_next, bool forward_direction) { if (!find_bar_.get()) { @@ -228,7 +228,7 @@ void WebContentsViewMac::Observe(NotificationType type, CFRetain(view); [view release]; sad_tab_.reset(view); - + // Set as the dominant child. [cocoa_view_.get() addSubview:view]; [view setFrame:[cocoa_view_.get() bounds]]; |