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

Unified Diff: chrome/browser/android/tab_web_contents_delegate_android.cc

Issue 1347543002: [Android] Fix refresh keyboard shortcut behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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
Index: chrome/browser/android/tab_web_contents_delegate_android.cc
diff --git a/chrome/browser/android/tab_web_contents_delegate_android.cc b/chrome/browser/android/tab_web_contents_delegate_android.cc
index f5b9d9d3127db9479616cbeed83a110bedc0d324..ba4b439913221180ac25102bac7a0690b954866b 100644
--- a/chrome/browser/android/tab_web_contents_delegate_android.cc
+++ b/chrome/browser/android/tab_web_contents_delegate_android.cc
@@ -26,8 +26,10 @@
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
#include "chrome/browser/ui/tab_helpers.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/url_constants.h"
#include "components/app_modal/javascript_dialog_manager.h"
#include "components/infobars/core/infobar.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -141,6 +143,24 @@ void TabWebContentsDelegateAndroid::CloseContents(
WebContentsDelegateAndroid::CloseContents(web_contents);
}
+bool TabWebContentsDelegateAndroid::ShouldFocusLocationBarByDefault(
+ WebContents* source) {
+ const content::NavigationEntry* entry =
+ source->GetController().GetActiveEntry();
+ if (entry) {
+ GURL url = entry->GetURL();
+ GURL virtual_url = entry->GetVirtualURL();
+ if ((url.SchemeIs(chrome::kChromeUINativeScheme) &&
+ url.host() == chrome::kChromeUINewTabHost) ||
+ (virtual_url.SchemeIs(chrome::kChromeUINativeScheme) &&
+ virtual_url.host() == chrome::kChromeUINewTabHost)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
void TabWebContentsDelegateAndroid::Observe(
int type,
const content::NotificationSource& source,
« no previous file with comments | « chrome/browser/android/tab_web_contents_delegate_android.h ('k') | content/browser/web_contents/web_contents_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698