summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/app_launcher.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 18:16:32 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 18:16:32 +0000
commit3b523d16aba55258411512ea63b2e95ea747717f (patch)
treef40a650999b39f4db7aa2ca148db0aa14a6fbfea /chrome/browser/views/app_launcher.cc
parent363250995f7ea9aaf2b47839ccd76448b54ffdb7 (diff)
downloadchromium_src-3b523d16aba55258411512ea63b2e95ea747717f.zip
chromium_src-3b523d16aba55258411512ea63b2e95ea747717f.tar.gz
chromium_src-3b523d16aba55258411512ea63b2e95ea747717f.tar.bz2
Fixes bug in app launcher. If the url is specified for the launcher
and the page tried to open a popup it would get eaten. BUG=Chrome OS bug 2770 TEST=see bug Review URL: http://codereview.chromium.org/1695012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/app_launcher.cc')
-rw-r--r--chrome/browser/views/app_launcher.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/views/app_launcher.cc b/chrome/browser/views/app_launcher.cc
index d1e87aa..b5fc226 100644
--- a/chrome/browser/views/app_launcher.cc
+++ b/chrome/browser/views/app_launcher.cc
@@ -52,6 +52,8 @@ const int kNavigationBarHeight = 25;
const int kAutocompleteEditFontDelta = 3;
// Command line switch for specifying url of the page.
+// TODO: nuke when we convert to the real app page. Also nuke code in
+// AddNewContents
const wchar_t kURLSwitch[] = L"main-menu-url";
// Returns the URL of the menu.
@@ -343,11 +345,25 @@ void AppLauncher::OpenURLFromTab(TabContents* source,
Hide();
}
+void AppLauncher::AddNewContents(TabContents* source,
+ TabContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) {
+#if defined(OS_CHROMEOS)
+ // ChromeOS uses the kURLSwitch to specify a page that opens popups. We need
+ // to do this so the popups are opened when the user clicks on the page.
+ // TODO: nuke when convert to the real app page.
+ new_contents->set_delegate(NULL);
+ browser_->GetSelectedTabContents()->AddNewContents(
+ new_contents, disposition, initial_pos, user_gesture);
+ Hide();
+#endif
+}
+
void AppLauncher::InfoBubbleClosing(InfoBubble* info_bubble,
bool closed_by_escape) {
- // The stack may have pending_contents_ on it. Delay deleting the
- // pending_contents_ as TabContents doesn't deal well with being deleted
- // while on the stack.
+ // Delay deleting to be safe (we, and our tabcontents may be on the stack).
MessageLoop::current()->PostTask(FROM_HERE,
new DeleteTask<AppLauncher>(this));
}