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

Side by Side Diff: chrome/browser/infobars/infobar_service.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/infobars/infobar_service.h" 5 #include "chrome/browser/infobars/infobar_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
10 #include "components/content_settings/content/common/content_settings_messages.h " 10 #include "components/content_settings/content/common/content_settings_messages.h "
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 web_contents()->RemoveUserData(UserDataKey()); 112 web_contents()->RemoveUserData(UserDataKey());
113 // That was the equivalent of "delete this". This object is now destroyed; 113 // That was the equivalent of "delete this". This object is now destroyed;
114 // returning from this function is the only safe thing to do. 114 // returning from this function is the only safe thing to do.
115 } 115 }
116 116
117 void InfoBarService::OpenURL(const GURL& url, 117 void InfoBarService::OpenURL(const GURL& url,
118 WindowOpenDisposition disposition) { 118 WindowOpenDisposition disposition) {
119 // A normal user click on an infobar URL will result in a CURRENT_TAB 119 // A normal user click on an infobar URL will result in a CURRENT_TAB
120 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up 120 // disposition; turn that into a NEW_FOREGROUND_TAB so that we don't end up
121 // smashing the page the user is looking at. 121 // smashing the page the user is looking at.
122 web_contents()->OpenURL(content::OpenURLParams( 122 web_contents()->OpenURL(
123 url, content::Referrer(), 123 content::OpenURLParams(url, content::Referrer(),
124 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 124 (disposition == WindowOpenDisposition::CURRENT_TAB)
125 ui::PAGE_TRANSITION_LINK, false)); 125 ? WindowOpenDisposition::NEW_FOREGROUND_TAB
126 : disposition,
127 ui::PAGE_TRANSITION_LINK, false));
126 } 128 }
OLDNEW
« no previous file with comments | « chrome/browser/history/redirect_browsertest.cc ('k') | chrome/browser/infobars/infobars_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698