From bcd9dc4cf88b89675eb605ffba94d345b33ee216 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Sat, 23 Jan 2010 16:38:18 +0000 Subject: Extension tweaks for phantom tabs. I did the following modifications: . Modified chrome.tabs.executeScript so that it sends error message if failure in sending message (which happens with phantom tabs). . When a tab is made phantom we send TabInsertedAt event. . Made connecting to a phantom tab send disconnect. . Disallow changing the url of pinned tabs. . Disallow closing phantom tabs. . Detect language fails for phantom tabs. And I removed the flag for phantom tabs. BUG=25309 TEST=on windows or chromeos create a window with a couple of tabs, pin the first, then close it. Selection should change to another tab and the favicon of the closed tab should remain, but not the tab border. control-tab should not select the phantom tab, but if you click on the phantom tab it should become live again and the border should reappear. Review URL: http://codereview.chromium.org/552110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36964 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents/tab_contents.cc | 4 ++-- chrome/browser/tab_contents/tab_contents.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'chrome/browser/tab_contents') diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 0ca822b..27c215e 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -833,11 +833,11 @@ void TabContents::CloseAllSuppressedPopups() { blocked_popups_->CloseAll(); } -void TabContents::ExecuteCode(int request_id, const std::string& extension_id, +bool TabContents::ExecuteCode(int request_id, const std::string& extension_id, const std::vector& host_permissions, bool is_js_code, const std::string& code_string, bool all_frames) { - render_view_host()->Send( + return render_view_host()->Send( new ViewMsg_ExecuteCode(render_view_host()->routing_id(), ViewMsg_ExecuteCode_Params(request_id, extension_id, host_permissions, is_js_code, code_string, all_frames))); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 0603d6b..2ea5bf5 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -367,8 +367,9 @@ class TabContents : public PageNavigator, // of unwanted popups. void CloseAllSuppressedPopups(); - // Execute code in this tab. - void ExecuteCode(int request_id, const std::string& extension_id, + // Execute code in this tab. Returns true if the message was successfully + // sent. + bool ExecuteCode(int request_id, const std::string& extension_id, const std::vector& host_permissions, bool is_js_code, const std::string& code_string, bool all_frames); -- cgit v1.1