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

Unified Diff: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc

Issue 2965043003: ToolbarModel: Supply offline page status. (Closed)
Patch Set: And, ios-simulator. Created 3 years, 5 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 | « chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h ('k') | components/toolbar/test_toolbar_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
diff --git a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
index 643a331d5494718f5afc54342b3a53388815135b..0f749b4d8ec578e227cb5534fbeabf917964c446 100644
--- a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
+++ b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h"
#include "base/logging.h"
+#include "build/build_config.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
@@ -22,7 +23,9 @@
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
-#if !defined(OS_ANDROID)
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/offline_pages/offline_page_utils.h"
+#else
#include "components/omnibox/browser/vector_icons.h" // nogncheck
#include "components/toolbar/vector_icons.h" // nogncheck
#endif
@@ -126,6 +129,17 @@ const gfx::VectorIcon* ChromeToolbarModelDelegate::GetVectorIconOverride()
return nullptr;
}
+bool ChromeToolbarModelDelegate::IsOfflinePage() const {
+#if defined(OS_ANDROID)
+ content::WebContents* web_contents = GetActiveWebContents();
+ return web_contents &&
+ offline_pages::OfflinePageUtils::GetOfflinePageFromWebContents(
+ web_contents);
+#else
+ return false;
+#endif
+}
+
content::NavigationController*
ChromeToolbarModelDelegate::GetNavigationController() const {
// This |current_tab| can be null during the initialization of the toolbar
« no previous file with comments | « chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h ('k') | components/toolbar/test_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698