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

Unified Diff: chrome/browser/ui/views/aura/status_area_host_aura.cc

Issue 8585031: [cros, Aura] Make screen_mode static variable in StatusAreaViewChromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month 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: chrome/browser/ui/views/aura/status_area_host_aura.cc
diff --git a/chrome/browser/ui/views/aura/status_area_host_aura.cc b/chrome/browser/ui/views/aura/status_area_host_aura.cc
index 21e74abf520c8ca513471741a21712e96b1237ed..7daad396831725c7ba3d95c42ecda3a6692f58f8 100644
--- a/chrome/browser/ui/views/aura/status_area_host_aura.cc
+++ b/chrome/browser/ui/views/aura/status_area_host_aura.cc
@@ -19,8 +19,11 @@
#include "ui/views/widget/widget.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/base_login_display_host.h"
+#include "chrome/browser/chromeos/login/proxy_settings_dialog.h"
#include "chrome/browser/chromeos/status/status_area_view_chromeos.h"
#include "chrome/browser/chromeos/status/timezone_clock_updater.h"
+#include "ui/gfx/native_widget_types.h"
#endif
StatusAreaHostAura::StatusAreaHostAura()
@@ -46,9 +49,9 @@ views::Widget* StatusAreaHostAura::CreateStatusArea() {
// Add child buttons.
#if defined(OS_CHROMEOS)
ClockMenuButton* clock = NULL;
- chromeos::StatusAreaViewChromeos::AddChromeosButtons(
- status_area_view_, this, chromeos::StatusAreaViewChromeos::BROWSER_MODE,
- &clock);
+ chromeos::StatusAreaViewChromeos::AddChromeosButtons(status_area_view_,
+ this,
+ &clock);
DCHECK(clock);
timezone_clock_updater_.reset(new TimezoneClockUpdater(clock));
#else
@@ -81,7 +84,15 @@ views::Widget* StatusAreaHostAura::CreateStatusArea() {
bool StatusAreaHostAura::ShouldExecuteStatusAreaCommand(
const views::View* button_view, int command_id) const {
#if defined(OS_CHROMEOS)
- return true;
+ if (chromeos::StatusAreaViewChromeos::IsLoginMode()) {
+ // In login mode network options command means proxy settings dialog.
+ if (command_id == StatusAreaButton::Delegate::SHOW_NETWORK_OPTIONS)
+ return true;
+ else
+ return false;
+ } else {
+ return true;
+ }
#else
// TODO(stevenjb): system options for non-chromeos Aura?
return false;
@@ -91,20 +102,33 @@ bool StatusAreaHostAura::ShouldExecuteStatusAreaCommand(
void StatusAreaHostAura::ExecuteStatusAreaCommand(
const views::View* button_view, int command_id) {
#if defined(OS_CHROMEOS)
- Browser* browser = BrowserList::FindBrowserWithProfile(
- ProfileManager::GetDefaultProfile());
- switch (command_id) {
- case StatusAreaButton::Delegate::SHOW_NETWORK_OPTIONS:
- browser->OpenInternetOptionsDialog();
- break;
- case StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS:
- browser->OpenLanguageOptionsDialog();
- break;
- case StatusAreaButton::Delegate::SHOW_SYSTEM_OPTIONS:
- browser->OpenSystemOptionsDialog();
- break;
- default:
+ if (chromeos::StatusAreaViewChromeos::IsBrowserMode()) {
+ Browser* browser = BrowserList::FindBrowserWithProfile(
+ ProfileManager::GetDefaultProfile());
+ switch (command_id) {
+ case StatusAreaButton::Delegate::SHOW_NETWORK_OPTIONS:
+ browser->OpenInternetOptionsDialog();
+ break;
+ case StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS:
+ browser->OpenLanguageOptionsDialog();
+ break;
+ case StatusAreaButton::Delegate::SHOW_SYSTEM_OPTIONS:
+ browser->OpenSystemOptionsDialog();
+ break;
+ default:
+ NOTREACHED();
+ }
+ } else if (chromeos::StatusAreaViewChromeos::IsLoginMode()) {
+ if (command_id == StatusAreaButton::Delegate::SHOW_NETWORK_OPTIONS &&
+ chromeos::BaseLoginDisplayHost::default_host()) {
+ gfx::NativeWindow native_window =
+ chromeos::BaseLoginDisplayHost::default_host()->GetNativeWindow();
+ proxy_settings_dialog_.reset(new chromeos::ProxySettingsDialog(
+ NULL, native_window));
+ proxy_settings_dialog_->Show();
+ } else {
NOTREACHED();
+ }
}
#endif
}
« no previous file with comments | « chrome/browser/ui/views/aura/status_area_host_aura.h ('k') | chrome/browser/ui/webui/chromeos/login/network_dropdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698