Commit aa153559 authored by ben@chromium.org's avatar ben@chromium.org

Replace most users of BrowserList::GetLastActive in feedback ui with more appropriate functions.

http://crbug.com/129187
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10388232

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138317 0039d316-1c4b-4281-b951-d872f2087c98
parent 047a422f
...@@ -357,6 +357,8 @@ bool FeedbackHandler::Init() { ...@@ -357,6 +357,8 @@ bool FeedbackHandler::Init() {
} }
#endif #endif
// TODO(beng): Replace GetLastActive with a more specific method of locating
// the target contents.
Browser* browser = BrowserList::GetLastActive(); Browser* browser = BrowserList::GetLastActive();
// Sanity checks. // Sanity checks.
if (((index == 0) && (index_str != "0")) || !browser || if (((index == 0) && (index_str != "0")) || !browser ||
...@@ -547,14 +549,13 @@ void FeedbackHandler::HandleCancel(const ListValue*) { ...@@ -547,14 +549,13 @@ void FeedbackHandler::HandleCancel(const ListValue*) {
void FeedbackHandler::HandleOpenSystemTab(const ListValue* args) { void FeedbackHandler::HandleOpenSystemTab(const ListValue* args) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
Browser* last_active = BrowserList::GetLastActive(); web_ui()->GetWebContents()->GetDelegate()->OpenURLFromTab(
last_active->OpenURL( web_ui()->GetWebContents(),
content::OpenURLParams(GURL(chrome::kChromeUISystemInfoURL), content::OpenURLParams(GURL(chrome::kChromeUISystemInfoURL),
content::Referrer(), content::Referrer(),
NEW_FOREGROUND_TAB, NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK, content::PAGE_TRANSITION_LINK,
false)); false));
last_active->window()->Activate();
#endif #endif
} }
...@@ -571,13 +572,7 @@ void FeedbackHandler::CancelFeedbackCollection() { ...@@ -571,13 +572,7 @@ void FeedbackHandler::CancelFeedbackCollection() {
void FeedbackHandler::CloseFeedbackTab() { void FeedbackHandler::CloseFeedbackTab() {
ClobberScreenshotsSource(); ClobberScreenshotsSource();
tab_->GetDelegate()->CloseContents(tab_);
Browser* browser = BrowserList::GetLastActive();
if (browser) {
browser->CloseTabContents(tab_);
} else {
LOG(FATAL) << "Failed to get last active browser.";
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment