Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/aura/status_area_host_aura.h" | 5 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 8 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
| 9 #include "chrome/browser/chromeos/status/memory_menu_button.h" | 9 #include "chrome/browser/chromeos/status/memory_menu_button.h" |
| 10 #include "chrome/browser/chromeos/status/status_area_view.h" | 10 #include "chrome/browser/chromeos/status/status_area_view.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 #else | 96 #else |
| 97 // TODO(stevenjb): system options for non-chromeos Aura? | 97 // TODO(stevenjb): system options for non-chromeos Aura? |
| 98 return false; | 98 return false; |
| 99 #endif | 99 #endif |
| 100 } | 100 } |
| 101 | 101 |
| 102 void StatusAreaHostAura::ExecuteStatusAreaCommand( | 102 void StatusAreaHostAura::ExecuteStatusAreaCommand( |
| 103 const views::View* button_view, int command_id) { | 103 const views::View* button_view, int command_id) { |
| 104 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
| 105 if (chromeos::StatusAreaViewChromeos::IsBrowserMode()) { | 105 if (chromeos::StatusAreaViewChromeos::IsBrowserMode()) { |
| 106 Browser* browser = BrowserList::FindBrowserWithProfile( | 106 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 107 ProfileManager::GetDefaultProfile()); | 107 Browser* browser = BrowserList::FindBrowserWithProfile(profile); |
| 108 if (!browser) | |
| 109 browser = Browser::Create(profile); | |
|
Nikita (slow)
2011/12/26 10:48:38
This will happen when there're no browser windows
| |
| 108 switch (command_id) { | 110 switch (command_id) { |
| 109 case StatusAreaButton::Delegate::SHOW_NETWORK_OPTIONS: | 111 case StatusAreaButton::Delegate::SHOW_NETWORK_OPTIONS: |
| 110 browser->OpenInternetOptionsDialog(); | 112 browser->OpenInternetOptionsDialog(); |
| 111 break; | 113 break; |
| 112 case StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS: | 114 case StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS: |
| 113 browser->OpenLanguageOptionsDialog(); | 115 browser->OpenLanguageOptionsDialog(); |
| 114 break; | 116 break; |
| 115 case StatusAreaButton::Delegate::SHOW_SYSTEM_OPTIONS: | 117 case StatusAreaButton::Delegate::SHOW_SYSTEM_OPTIONS: |
| 116 browser->OpenSystemOptionsDialog(); | 118 browser->OpenSystemOptionsDialog(); |
| 117 break; | 119 break; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 138 } | 140 } |
| 139 | 141 |
| 140 StatusAreaButton::TextStyle StatusAreaHostAura::GetStatusAreaTextStyle() const { | 142 StatusAreaButton::TextStyle StatusAreaHostAura::GetStatusAreaTextStyle() const { |
| 141 return StatusAreaButton::WHITE_HALOED; | 143 return StatusAreaButton::WHITE_HALOED; |
| 142 } | 144 } |
| 143 | 145 |
| 144 void StatusAreaHostAura::ButtonVisibilityChanged(views::View* button_view) { | 146 void StatusAreaHostAura::ButtonVisibilityChanged(views::View* button_view) { |
| 145 if (status_area_view_) | 147 if (status_area_view_) |
| 146 status_area_view_->UpdateButtonVisibility(); | 148 status_area_view_->UpdateButtonVisibility(); |
| 147 } | 149 } |
| OLD | NEW |