| 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 "chrome/browser/chromeos/options/network_config_view.h" | 5 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "ui/views/widget/widget.h" | 39 #include "ui/views/widget/widget.h" |
| 40 | 40 |
| 41 using views::Widget; | 41 using views::Widget; |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 gfx::NativeWindow GetParentForUnhostedDialog() { | 45 gfx::NativeWindow GetParentForUnhostedDialog() { |
| 46 if (chromeos::LoginDisplayHostImpl::default_host()) { | 46 if (chromeos::LoginDisplayHostImpl::default_host()) { |
| 47 return chromeos::LoginDisplayHostImpl::default_host()->GetNativeWindow(); | 47 return chromeos::LoginDisplayHostImpl::default_host()->GetNativeWindow(); |
| 48 } else { | 48 } else { |
| 49 Browser* browser = chrome::FindTabbedBrowser( | 49 Browser* browser = |
| 50 ProfileManager::GetPrimaryUserProfile(), | 50 chrome::FindTabbedBrowser(ProfileManager::GetPrimaryUserProfile(), true, |
| 51 true, | 51 ui::HOST_DESKTOP_TYPE_ASH); |
| 52 chrome::HOST_DESKTOP_TYPE_ASH); | |
| 53 if (browser) | 52 if (browser) |
| 54 return browser->window()->GetNativeWindow(); | 53 return browser->window()->GetNativeWindow(); |
| 55 } | 54 } |
| 56 return NULL; | 55 return NULL; |
| 57 } | 56 } |
| 58 | 57 |
| 59 // Avoid global static initializer. | 58 // Avoid global static initializer. |
| 60 chromeos::NetworkConfigView** GetActiveDialogPointer() { | 59 chromeos::NetworkConfigView** GetActiveDialogPointer() { |
| 61 static chromeos::NetworkConfigView* active_dialog = NULL; | 60 static chromeos::NetworkConfigView* active_dialog = NULL; |
| 62 return &active_dialog; | 61 return &active_dialog; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 image_view_ = new views::ImageView(); | 354 image_view_ = new views::ImageView(); |
| 356 // Disable |image_view_| so mouse events propagate to the parent. | 355 // Disable |image_view_| so mouse events propagate to the parent. |
| 357 image_view_->SetEnabled(false); | 356 image_view_->SetEnabled(false); |
| 358 image_view_->SetImage(image_); | 357 image_view_->SetImage(image_); |
| 359 image_view_->SetTooltipText( | 358 image_view_->SetTooltipText( |
| 360 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); | 359 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); |
| 361 AddChildView(image_view_); | 360 AddChildView(image_view_); |
| 362 } | 361 } |
| 363 | 362 |
| 364 } // namespace chromeos | 363 } // namespace chromeos |
| OLD | NEW |