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

Unified Diff: ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm

Issue 2606873002: Move the offline URL trimming to GetFormattedURL. (Closed)
Patch Set: fix DEPS Created 4 years 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: ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm
index e2f6d17b574225f959cbf205c4fd65a8c14210ba..3933efd20c2dd9aeb9aa6c32f2ad82a9827f3fea 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm
+++ b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm
@@ -13,7 +13,6 @@
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/chrome_url_constants.h"
#include "ios/chrome/browser/pref_names.h"
-#include "ios/chrome/browser/reading_list/offline_url_utils.h"
#include "ios/chrome/browser/ssl/ios_security_state_tab_helper.h"
#import "ios/chrome/browser/tabs/tab.h"
#import "ios/chrome/browser/tabs/tab_model.h"
@@ -53,25 +52,7 @@ bool ToolbarModelDelegateIOS::GetURL(GURL* url) const {
web::NavigationItem* item = GetNavigationItem();
if (!item)
return false;
-
- if (!ShouldDisplayURL()) {
- *url = GURL();
- return true;
- }
-
- // For security reasons, we shouldn't display the https scheme and secure
- // padlock when there's no active ssl session.
- // To hide the scheme we set it http when the loaded url is offline.
- if (reading_list::IsOfflineURL(item->GetURL()) &&
- item->GetVirtualURL().SchemeIs(url::kHttpsScheme)) {
- GURL::Replacements replacements;
- replacements.SetScheme(url::kHttpScheme,
- url::Component(0, strlen(url::kHttpScheme)));
- *url = item->GetVirtualURL().ReplaceComponents(replacements);
- return true;
- }
-
- *url = item->GetVirtualURL();
+ *url = ShouldDisplayURL() ? item->GetVirtualURL() : GURL::EmptyGURL();
return true;
}
« no previous file with comments | « ios/chrome/browser/ui/toolbar/test_toolbar_model_ios.mm ('k') | ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698