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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 namespace chromeos { | 43 namespace chromeos { |
44 | 44 |
45 namespace { | 45 namespace { |
46 | 46 |
47 gfx::NativeWindow GetParentForUnhostedDialog() { | 47 gfx::NativeWindow GetParentForUnhostedDialog() { |
48 if (LoginDisplayHost::default_host()) { | 48 if (LoginDisplayHost::default_host()) { |
49 return LoginDisplayHost::default_host()->GetNativeWindow(); | 49 return LoginDisplayHost::default_host()->GetNativeWindow(); |
50 } else { | 50 } else { |
51 Browser* browser = chrome::FindTabbedBrowser( | 51 Browser* browser = chrome::FindTabbedBrowser( |
52 ProfileManager::GetPrimaryUserProfile(), | 52 ProfileManager::GetPrimaryUserProfile(), true); |
53 true, | |
54 chrome::HOST_DESKTOP_TYPE_ASH); | |
55 if (browser) | 53 if (browser) |
56 return browser->window()->GetNativeWindow(); | 54 return browser->window()->GetNativeWindow(); |
57 } | 55 } |
58 return nullptr; | 56 return nullptr; |
59 } | 57 } |
60 | 58 |
61 // Avoid global static initializer. | 59 // Avoid global static initializer. |
62 NetworkConfigView** GetActiveDialogPointer() { | 60 NetworkConfigView** GetActiveDialogPointer() { |
63 static NetworkConfigView* active_dialog = nullptr; | 61 static NetworkConfigView* active_dialog = nullptr; |
64 return &active_dialog; | 62 return &active_dialog; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 image_view_ = new views::ImageView(); | 351 image_view_ = new views::ImageView(); |
354 // Disable |image_view_| so mouse events propagate to the parent. | 352 // Disable |image_view_| so mouse events propagate to the parent. |
355 image_view_->SetEnabled(false); | 353 image_view_->SetEnabled(false); |
356 image_view_->SetImage(image_); | 354 image_view_->SetImage(image_); |
357 image_view_->SetTooltipText( | 355 image_view_->SetTooltipText( |
358 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); | 356 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); |
359 AddChildView(image_view_); | 357 AddChildView(image_view_); |
360 } | 358 } |
361 | 359 |
362 } // namespace chromeos | 360 } // namespace chromeos |
OLD | NEW |