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

Unified Diff: chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc

Issue 10332293: Make KeyboardOverlayUI use WebContentsDelegate instead of BrowserList::GetLastActive(). (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/chromeos/keyboard_overlay_ui.cc
===================================================================
--- chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc (revision 138102)
+++ chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc (working copy)
@@ -13,15 +13,15 @@
#include "chrome/browser/chromeos/input_method/xkeyboard.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "grit/browser_resources.h"
@@ -304,10 +304,13 @@
}
void KeyboardOverlayHandler::OpenLearnMorePage(const ListValue* args) {
- Browser* browser = BrowserList::GetLastActive();
- DCHECK(browser);
- browser->AddSelectedTabWithURL(GURL(kLearnMoreURL),
- content::PAGE_TRANSITION_LINK);
+ web_ui()->GetWebContents()->GetDelegate()->OpenURLFromTab(
+ web_ui()->GetWebContents(),
+ content::OpenURLParams(GURL(kLearnMoreURL),
+ content::Referrer(),
+ NEW_FOREGROUND_TAB,
+ content::PAGE_TRANSITION_LINK,
+ false));
}
////////////////////////////////////////////////////////////////////////////////
« 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