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

Unified Diff: chrome/browser/ui/webui/feedback_ui.cc

Issue 10388232: Replace most users of BrowserList::GetLastActive in feedback ui with more appropriate functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/feedback_ui.cc
===================================================================
--- chrome/browser/ui/webui/feedback_ui.cc (revision 138102)
+++ chrome/browser/ui/webui/feedback_ui.cc (working copy)
@@ -357,6 +357,8 @@
}
#endif
+ // TODO(beng): Replace GetLastActive with a more specific method of locating
+ // the target contents.
Browser* browser = BrowserList::GetLastActive();
// Sanity checks.
if (((index == 0) && (index_str != "0")) || !browser ||
@@ -547,14 +549,13 @@
void FeedbackHandler::HandleOpenSystemTab(const ListValue* args) {
#if defined(OS_CHROMEOS)
- Browser* last_active = BrowserList::GetLastActive();
- last_active->OpenURL(
+ web_ui()->GetWebContents()->GetDelegate()->OpenURLFromTab(
+ web_ui()->GetWebContents(),
content::OpenURLParams(GURL(chrome::kChromeUISystemInfoURL),
content::Referrer(),
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,
false));
- last_active->window()->Activate();
#endif
}
@@ -571,13 +572,7 @@
void FeedbackHandler::CloseFeedbackTab() {
ClobberScreenshotsSource();
-
- Browser* browser = BrowserList::GetLastActive();
- if (browser) {
- browser->CloseTabContents(tab_);
- } else {
- LOG(FATAL) << "Failed to get last active browser.";
- }
+ tab_->GetDelegate()->CloseContents(tab_);
}
////////////////////////////////////////////////////////////////////////////////
Property changes on: chrome\browser\ui\webui\feedback_ui.cc
___________________________________________________________________
Deleted: svn:mergeinfo
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698