| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/tray/tray_details_view.h" | 5 #include "ash/system/tray/tray_details_view.h" |
| 6 | 6 |
| 7 #include "ash/ash_view_ids.h" | 7 #include "ash/ash_view_ids.h" |
| 8 #include "ash/strings/grit/ash_strings.h" | 8 #include "ash/strings/grit/ash_strings.h" |
| 9 #include "ash/system/tray/system_menu_button.h" | 9 #include "ash/system/tray/system_menu_button.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 progress_bar_->SetVisible(false); | 319 progress_bar_->SetVisible(false); |
| 320 AddChildViewAt(progress_bar_, kTitleRowSeparatorIndex + 1); | 320 AddChildViewAt(progress_bar_, kTitleRowSeparatorIndex + 1); |
| 321 } | 321 } |
| 322 | 322 |
| 323 progress_bar_->SetValue(value); | 323 progress_bar_->SetValue(value); |
| 324 progress_bar_->SetVisible(visible); | 324 progress_bar_->SetVisible(visible); |
| 325 child_at(kTitleRowSeparatorIndex)->SetVisible(!visible); | 325 child_at(kTitleRowSeparatorIndex)->SetVisible(!visible); |
| 326 } | 326 } |
| 327 | 327 |
| 328 views::CustomButton* TrayDetailsView::CreateSettingsButton( | 328 views::CustomButton* TrayDetailsView::CreateSettingsButton( |
| 329 LoginStatus status, | |
| 330 int setting_accessible_name_id) { | 329 int setting_accessible_name_id) { |
| 331 SystemMenuButton* button = | 330 SystemMenuButton* button = |
| 332 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, | 331 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, |
| 333 kSystemMenuSettingsIcon, setting_accessible_name_id); | 332 kSystemMenuSettingsIcon, setting_accessible_name_id); |
| 334 if (!TrayPopupUtils::CanOpenWebUISettings(status)) | 333 if (!TrayPopupUtils::CanOpenWebUISettings()) |
| 335 button->SetEnabled(false); | 334 button->SetEnabled(false); |
| 336 return button; | 335 return button; |
| 337 } | 336 } |
| 338 | 337 |
| 339 views::CustomButton* TrayDetailsView::CreateHelpButton(LoginStatus status) { | 338 views::CustomButton* TrayDetailsView::CreateHelpButton() { |
| 340 SystemMenuButton* button = | 339 SystemMenuButton* button = |
| 341 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, | 340 new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED, |
| 342 kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP); | 341 kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP); |
| 343 if (!TrayPopupUtils::CanOpenWebUISettings(status)) | 342 // Help opens a web page, so treat it like Web UI settings. |
| 343 if (!TrayPopupUtils::CanOpenWebUISettings()) |
| 344 button->SetEnabled(false); | 344 button->SetEnabled(false); |
| 345 return button; | 345 return button; |
| 346 } | 346 } |
| 347 | 347 |
| 348 void TrayDetailsView::HandleViewClicked(views::View* view) { | 348 void TrayDetailsView::HandleViewClicked(views::View* view) { |
| 349 NOTREACHED(); | 349 NOTREACHED(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void TrayDetailsView::HandleButtonPressed(views::Button* sender, | 352 void TrayDetailsView::HandleButtonPressed(views::Button* sender, |
| 353 const ui::Event& event) { | 353 const ui::Event& event) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 if (bounds().IsEmpty()) | 391 if (bounds().IsEmpty()) |
| 392 return views::View::GetHeightForWidth(width); | 392 return views::View::GetHeightForWidth(width); |
| 393 | 393 |
| 394 // The height of the bubble that contains this detailed view is set to | 394 // The height of the bubble that contains this detailed view is set to |
| 395 // the preferred height of the default view, and that determines the | 395 // the preferred height of the default view, and that determines the |
| 396 // initial height of |this|. Always request to stay the same height. | 396 // initial height of |this|. Always request to stay the same height. |
| 397 return height(); | 397 return height(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 } // namespace ash | 400 } // namespace ash |
| OLD | NEW |