Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: chrome/browser/ui/browser_commands.cc

Issue 1158523002: Add user_gesture param to BaseWindow::Show Base URL: https://chromium.googlesource.com/chromium/src.git@ug3_BaseWindow_Activate
Patch Set: Update callers Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_close_browsertest.cc ('k') | chrome/browser/ui/browser_focus_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 90e6be26a667bd490229e8390daea3476e443267..1c22505256bf7a5f13e4dc9d0d113578da967679 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -193,7 +193,7 @@ WebContents* GetTabAndRevertIfNecessary(Browser* browser,
new_browser->tab_strip_model()->AddWebContents(
new_tab, -1, ui::PAGE_TRANSITION_LINK,
TabStripModel::ADD_ACTIVE);
- new_browser->window()->Show();
+ new_browser->window()->Show(true /* user_gesture */);
return new_tab;
}
default:
@@ -346,7 +346,7 @@ Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) {
Browser* browser = new Browser(
Browser::CreateParams(Browser::TYPE_TABBED, profile, desktop_type));
AddTabAt(browser, GURL(), -1, true);
- browser->window()->Show();
+ browser->window()->Show(true /* user_gesture */);
return browser;
}
@@ -552,7 +552,8 @@ void NewTab(Browser* browser) {
browser->host_desktop_type());
Browser* b = displayer.browser();
AddTabAt(b, GURL(), -1, true);
- b->window()->Show();
+ // TODO(johnme): Pass true to |Show| for user-initiated commands.
+ b->window()->Show(false /* user_gesture */);
// The call to AddBlankTabAt above did not set the focus to the tab as its
// window was not active, so we have to do it explicitly.
// See http://crbug.com/6380.
@@ -676,7 +677,8 @@ WebContents* DuplicateTabAt(Browser* browser, int index) {
// We need to show the browser now. Otherwise ContainerWin assumes the
// WebContents is invisible and won't size it.
- new_browser->window()->Show();
+ // TODO(johnme): Pass true to |Show| for user-initiated commands.
+ new_browser->window()->Show(false /* user_gesture */);
// The page transition below is only for the purpose of inserting the tab.
new_browser->tab_strip_model()->AddWebContents(
@@ -706,7 +708,7 @@ void ConvertPopupToTabbedBrowser(Browser* browser) {
Browser* b = new Browser(Browser::CreateParams(browser->profile(),
browser->host_desktop_type()));
b->tab_strip_model()->AppendWebContents(contents, true);
- b->window()->Show();
+ b->window()->Show(true /* user_gesture */);
}
void Exit() {
@@ -1207,7 +1209,7 @@ void ViewSource(Browser* browser,
// We need to show the browser now. Otherwise ContainerWin assumes the
// WebContents is invisible and won't size it.
- b->window()->Show();
+ b->window()->Show(true /* user_gesture */);
// The page transition below is only for the purpose of inserting the tab.
b->tab_strip_model()->AddWebContents(view_source_contents, -1,
@@ -1277,7 +1279,7 @@ void ConvertTabToAppWindow(Browser* browser,
contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
contents->GetRenderViewHost()->SyncRendererPrefs();
- app_browser->window()->Show();
+ app_browser->window()->Show(true /* user_gesture */);
}
#endif // defined(ENABLE_EXTENSIONS)
« no previous file with comments | « chrome/browser/ui/browser_close_browsertest.cc ('k') | chrome/browser/ui/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698