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

Unified Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc

Issue 338423005: Add back button to chrome://devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-trying icon upload? Created 6 years, 6 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/resources/local_discovery/local_discovery.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
index f21c2b51ef25fba546f618385f8ba441222abcbc..fc01fd3dd9f1beeb9db512e03db40670c3260f3b 100644
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui.cc
@@ -5,10 +5,13 @@
#include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "grit/browser_resources.h"
@@ -84,7 +87,7 @@ content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() {
IDS_LOCAL_DISCOVERY_AVAILABLE_DEVICES);
source->AddLocalizedString("myDevicesTitle",
IDS_LOCAL_DISCOVERY_MY_DEVICES);
-
+ source->AddLocalizedString("backButton", IDS_SETTINGS_TITLE);
// Cloud print connector-related strings.
#if defined(ENABLE_FULL_PRINTING) && !defined(OS_CHROMEOS)
@@ -112,8 +115,13 @@ content::WebUIDataSource* CreateLocalDiscoveryHTMLSource() {
LocalDiscoveryUI::LocalDiscoveryUI(content::WebUI* web_ui)
: WebUIController(web_ui) {
// Set up the chrome://devices/ source.
- Profile* profile = Profile::FromWebUI(web_ui);
- content::WebUIDataSource::Add(profile, CreateLocalDiscoveryHTMLSource());
+ content::WebUIDataSource* source = CreateLocalDiscoveryHTMLSource();
+ Browser* browser =
+ chrome::FindBrowserWithWebContents(web_ui->GetWebContents());
+ // Show a back button pointing to Settings if the browser has no location bar.
+ if (browser && browser->is_trusted_source())
+ source->AddString("backButtonURL", chrome::kChromeUISettingsURL);
+ content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
// TODO(gene): Use LocalDiscoveryUIHandler to send updated to the devices
// page. For example
« no previous file with comments | « chrome/browser/resources/local_discovery/local_discovery.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698