diff options
author | petewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-26 12:55:06 +0000 |
---|---|---|
committer | petewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-26 12:55:06 +0000 |
commit | 0e24f0b320214b98b087d0671856f2cd6efc797c (patch) | |
tree | e5c5f21eaa5d685ce6147a47c768ca2785dab2ef | |
parent | 549f62b3adb083e662b4909d7f74e5a32e207f4c (diff) | |
download | chromium_src-0e24f0b320214b98b087d0671856f2cd6efc797c.zip chromium_src-0e24f0b320214b98b087d0671856f2cd6efc797c.tar.gz chromium_src-0e24f0b320214b98b087d0671856f2cd6efc797c.tar.bz2 |
Fix notification click focus issues
When the user clicked on a notification, we were not getting a browser
window to pop up if the user dismissed the window, and if it did come up,
it would not pop to the top. This change fixes both problems.
BUG=305900
Review URL: https://codereview.chromium.org/34393014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231205 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.cc index 9585d81..75923d9 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.cc +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_delegate.cc @@ -10,6 +10,7 @@ #include "chrome/browser/notifications/sync_notifier/synced_notification.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_window.h" #include "content/public/browser/page_navigator.h" #include "content/public/browser/user_metrics.h" @@ -74,12 +75,16 @@ void ChromeNotifierDelegate::NavigateToUrl(const GURL& destination) const { content::OpenURLParams openParams(destination, content::Referrer(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false); - Browser* browser = chrome::FindLastActiveWithProfile( + Browser* browser = chrome::FindOrCreateTabbedBrowser( chrome_notifier_->profile(), chrome::GetActiveDesktop()); // Navigate to the URL in a new tab. - if (browser != NULL) + if (browser != NULL) { browser->OpenURL(openParams); + browser->window()->Activate(); + } else { + DVLOG(2) << "NavigateToUrl failed to create a browser."; + } } |