summaryrefslogtreecommitdiffstats
path: root/chromeos/network
diff options
context:
space:
mode:
authorfqj <fqj@chromium.org>2015-11-17 14:41:53 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-17 22:42:57 +0000
commit9bbb6b3f5f8973b8c8389858e2f421e36554b831 (patch)
tree4dbe2740d6134ec344f174591da3267b66073882 /chromeos/network
parentbdb9d194c286a4f79e9c048a4914fbe56e768bf2 (diff)
downloadchromium_src-9bbb6b3f5f8973b8c8389858e2f421e36554b831.zip
chromium_src-9bbb6b3f5f8973b8c8389858e2f421e36554b831.tar.gz
chromium_src-9bbb6b3f5f8973b8c8389858e2f421e36554b831.tar.bz2
UI changes to disable button for prohibted technologies
This commit grays out the buttons for some specific technologies, and modifies the hint text of system tray for user session if they are prohibited. It also removes the corresponding elements in chrome://settings page. Depends on: https://codereview.chromium.org/1431563005/ BUG=426390 Review URL: https://codereview.chromium.org/1434443002 Cr-Commit-Position: refs/heads/master@{#360186}
Diffstat (limited to 'chromeos/network')
-rw-r--r--chromeos/network/network_state_handler.cc2
-rw-r--r--chromeos/network/network_state_handler.h6
-rw-r--r--chromeos/network/shill_property_handler.cc5
-rw-r--r--chromeos/network/shill_property_handler.h1
4 files changed, 13 insertions, 1 deletions
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index 5007837..e2ea522 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -114,6 +114,8 @@ NetworkStateHandler::TechnologyState NetworkStateHandler::GetTechnologyState(
state = TECHNOLOGY_ENABLED;
else if (shill_property_handler_->IsTechnologyEnabling(technology))
state = TECHNOLOGY_ENABLING;
+ else if (shill_property_handler_->IsTechnologyProhibited(technology))
+ state = TECHNOLOGY_PROHIBITED;
else if (shill_property_handler_->IsTechnologyUninitialized(technology))
state = TECHNOLOGY_UNINITIALIZED;
else if (shill_property_handler_->IsTechnologyAvailable(technology))
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h
index a700f82..7dd422c 100644
--- a/chromeos/network/network_state_handler.h
+++ b/chromeos/network/network_state_handler.h
@@ -74,7 +74,8 @@ class CHROMEOS_EXPORT NetworkStateHandler
TECHNOLOGY_AVAILABLE,
TECHNOLOGY_UNINITIALIZED,
TECHNOLOGY_ENABLING,
- TECHNOLOGY_ENABLED
+ TECHNOLOGY_ENABLED,
+ TECHNOLOGY_PROHIBITED
};
~NetworkStateHandler() override;
@@ -94,6 +95,9 @@ class CHROMEOS_EXPORT NetworkStateHandler
bool IsTechnologyEnabled(const NetworkTypePattern& type) const {
return GetTechnologyState(type) == TECHNOLOGY_ENABLED;
}
+ bool IsTechnologyProhibited(const NetworkTypePattern& type) const {
+ return GetTechnologyState(type) == TECHNOLOGY_PROHIBITED;
+ }
// Asynchronously sets the technology enabled property for |type|. Only
// NetworkTypePattern::Primitive, ::Mobile and ::Ethernet are supported.
diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc
index eb73b83..41482be 100644
--- a/chromeos/network/shill_property_handler.cc
+++ b/chromeos/network/shill_property_handler.cc
@@ -143,6 +143,11 @@ bool ShillPropertyHandler::IsTechnologyEnabling(
return enabling_technologies_.count(technology) != 0;
}
+bool ShillPropertyHandler::IsTechnologyProhibited(
+ const std::string& technology) const {
+ return prohibited_technologies_.count(technology) != 0;
+}
+
bool ShillPropertyHandler::IsTechnologyUninitialized(
const std::string& technology) const {
return uninitialized_technologies_.count(technology) != 0;
diff --git a/chromeos/network/shill_property_handler.h b/chromeos/network/shill_property_handler.h
index d88ac28..b4b6202 100644
--- a/chromeos/network/shill_property_handler.h
+++ b/chromeos/network/shill_property_handler.h
@@ -114,6 +114,7 @@ class CHROMEOS_EXPORT ShillPropertyHandler
bool IsTechnologyAvailable(const std::string& technology) const;
bool IsTechnologyEnabled(const std::string& technology) const;
bool IsTechnologyEnabling(const std::string& technology) const;
+ bool IsTechnologyProhibited(const std::string& technology) const;
bool IsTechnologyUninitialized(const std::string& technology) const;
// Asynchronously sets the enabled state for |technology|.