summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 23:19:45 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 23:19:45 +0000
commitd76b545dfbee1cb546d7595a1cfc2c3c0ba0efe3 (patch)
treeae852e59407f6ad3001d95079e83aa4376279fe0
parent6254067311c84cdd1edc01fadc950a5f14e4854f (diff)
downloadchromium_src-d76b545dfbee1cb546d7595a1cfc2c3c0ba0efe3.zip
chromium_src-d76b545dfbee1cb546d7595a1cfc2c3c0ba0efe3.tar.gz
chromium_src-d76b545dfbee1cb546d7595a1cfc2c3c0ba0efe3.tar.bz2
When you clicked Get Themes in Mac prefs, the browser window containing the themes gallery wasn't coming to the front.
There was an implicit assumption on Windows that TabContentsViewWin::Focus caused the window containing the TabContents to be foregrounded. This is because on Windows a HWND is focused with a call to SetFocus, which activates the containing top level window. On Mac, TabContentsViewMac::Focus needs to explicitly activate the containing window. Also, changes the Mac preferences code to call the same function as on Windows, for simplicity. Note: the "foreground" parameter to AddTabWithURL means the tab is opened in the foreground, not that the window is activated. http://crbug.com/18157 TEST=none Review URL: http://codereview.chromium.org/165492 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23378 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm1
2 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index bfb2fd9..305ff24 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -716,9 +716,9 @@ const int kDisabledIndex = 1;
GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)),
GURL(), NEW_WINDOW, PageTransition::LINK);
} else {
- browser->AddTabWithURL(
+ browser->OpenURL(
GURL(l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)),
- GURL(), PageTransition::LINK, true, -1, false, NULL);
+ GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK);
}
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index 281d7d1..1b3877c 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -144,6 +144,7 @@ void TabContentsViewMac::SizeContents(const gfx::Size& size) {
void TabContentsViewMac::Focus() {
[[cocoa_view_.get() window] makeFirstResponder:GetContentNativeView()];
+ [[cocoa_view_.get() window] makeKeyAndOrderFront:GetContentNativeView()];
}
void TabContentsViewMac::SetInitialFocus() {