OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.chrome.browser.customtabs; | 5 package org.chromium.chrome.browser.customtabs; |
6 | 6 |
7 import android.app.PendingIntent; | 7 import android.app.PendingIntent; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.net.Uri; | 10 import android.net.Uri; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 return super.onKeyDown(keyCode, event); | 623 return super.onKeyDown(keyCode, event); |
624 } | 624 } |
625 return KeyboardShortcuts.onKeyDown(event, this, true, false) | 625 return KeyboardShortcuts.onKeyDown(event, this, true, false) |
626 || super.onKeyDown(keyCode, event); | 626 || super.onKeyDown(keyCode, event); |
627 } | 627 } |
628 | 628 |
629 @Override | 629 @Override |
630 public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) { | 630 public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) { |
631 // Disable creating new tabs, bookmark, history, print, help, focus_url,
etc. | 631 // Disable creating new tabs, bookmark, history, print, help, focus_url,
etc. |
632 if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id | 632 if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id |
633 || id == R.id.print_id || id == R.id.help_id | 633 || id == R.id.help_id || id == R.id.recent_tabs_menu_id |
634 || id == R.id.recent_tabs_menu_id || id == R.id.new_incognito_ta
b_menu_id | 634 || id == R.id.new_incognito_tab_menu_id || id == R.id.new_tab_me
nu_id |
635 || id == R.id.new_tab_menu_id || id == R.id.open_history_menu_id
) { | 635 || id == R.id.open_history_menu_id) { |
636 return true; | 636 return true; |
637 } else if (id == R.id.open_in_browser_id) { | 637 } else if (id == R.id.open_in_browser_id) { |
638 openCurrentUrlInBrowser(false, true); | 638 openCurrentUrlInBrowser(false, true); |
639 RecordUserAction.record("CustomTabsMenuOpenInChrome"); | 639 RecordUserAction.record("CustomTabsMenuOpenInChrome"); |
640 return true; | 640 return true; |
641 } else if (id == R.id.read_it_later_id) { | 641 } else if (id == R.id.read_it_later_id) { |
642 openCurrentUrlInBrowser(false, false); | 642 openCurrentUrlInBrowser(false, false); |
643 RecordUserAction.record("CustomTabsMenuReadItLater"); | 643 RecordUserAction.record("CustomTabsMenuReadItLater"); |
644 return true; | 644 return true; |
645 } else if (id == R.id.info_menu_id) { | 645 } else if (id == R.id.info_menu_id) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 * overridden if the Data Reduction Proxy is using Lo-Fi previews. | 785 * overridden if the Data Reduction Proxy is using Lo-Fi previews. |
786 */ | 786 */ |
787 private String getUrlToLoad() { | 787 private String getUrlToLoad() { |
788 String url = IntentHandler.getUrlFromIntent(getIntent()); | 788 String url = IntentHandler.getUrlFromIntent(getIntent()); |
789 if (!TextUtils.isEmpty(url)) { | 789 if (!TextUtils.isEmpty(url)) { |
790 url = DataReductionProxySettings.getInstance().maybeRewriteWebliteUr
l(url); | 790 url = DataReductionProxySettings.getInstance().maybeRewriteWebliteUr
l(url); |
791 } | 791 } |
792 return url; | 792 return url; |
793 } | 793 } |
794 } | 794 } |
OLD | NEW |