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

Side by Side Diff: chrome/browser/chromeos/options/network_config_view.cc

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check_deps exception to specific_include_rules after chat with Kai. Created 8 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/chromeos/login/base_login_display_host.h" 11 #include "chrome/browser/chromeos/login/base_login_display_host.h"
12 #include "chrome/browser/chromeos/options/vpn_config_view.h" 12 #include "chrome/browser/chromeos/options/vpn_config_view.h"
13 #include "chrome/browser/chromeos/options/wifi_config_view.h" 13 #include "chrome/browser/chromeos/options/wifi_config_view.h"
14 #include "chrome/browser/chromeos/options/wimax_config_view.h" 14 #include "chrome/browser/chromeos/options/wimax_config_view.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_finder.h" 17 #include "chrome/browser/ui/browser_finder.h"
18 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
19 #include "chrome/browser/ui/host_desktop.h"
19 #include "grit/chromium_strings.h" 20 #include "grit/chromium_strings.h"
20 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
21 #include "grit/locale_settings.h" 22 #include "grit/locale_settings.h"
22 #include "grit/theme_resources.h" 23 #include "grit/theme_resources.h"
23 #include "ui/base/accessibility/accessible_view_state.h" 24 #include "ui/base/accessibility/accessible_view_state.h"
24 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/resource/resource_bundle.h" 26 #include "ui/base/resource/resource_bundle.h"
26 #include "ui/gfx/image/image.h" 27 #include "ui/gfx/image/image.h"
27 #include "ui/gfx/rect.h" 28 #include "ui/gfx/rect.h"
28 #include "ui/views/controls/button/text_button.h" 29 #include "ui/views/controls/button/text_button.h"
29 #include "ui/views/controls/image_view.h" 30 #include "ui/views/controls/image_view.h"
30 #include "ui/views/layout/grid_layout.h" 31 #include "ui/views/layout/grid_layout.h"
31 #include "ui/views/layout/layout_constants.h" 32 #include "ui/views/layout/layout_constants.h"
32 #include "ui/views/widget/widget.h" 33 #include "ui/views/widget/widget.h"
33 34
34 namespace { 35 namespace {
35 36
36 gfx::NativeWindow GetDialogParent() { 37 gfx::NativeWindow GetDialogParent() {
37 if (chromeos::BaseLoginDisplayHost::default_host()) { 38 if (chromeos::BaseLoginDisplayHost::default_host()) {
38 return chromeos::BaseLoginDisplayHost::default_host()->GetNativeWindow(); 39 return chromeos::BaseLoginDisplayHost::default_host()->GetNativeWindow();
39 } else { 40 } else {
40 Browser* browser = browser::FindTabbedBrowser( 41 Browser* browser = browser::FindTabbedBrowser(
41 ProfileManager::GetDefaultProfileOrOffTheRecord(), true); 42 ProfileManager::GetDefaultProfileOrOffTheRecord(),
43 true,
44 chrome::HOST_DESKTOP_TYPE_ASH);
42 if (browser) 45 if (browser)
43 return browser->window()->GetNativeWindow(); 46 return browser->window()->GetNativeWindow();
44 } 47 }
45 return NULL; 48 return NULL;
46 } 49 }
47 50
48 // Avoid global static initializer. 51 // Avoid global static initializer.
49 chromeos::NetworkConfigView** GetActiveDialogPointer() { 52 chromeos::NetworkConfigView** GetActiveDialogPointer() {
50 static chromeos::NetworkConfigView* active_dialog = NULL; 53 static chromeos::NetworkConfigView* active_dialog = NULL;
51 return &active_dialog; 54 return &active_dialog;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 image_view_ = new views::ImageView(); 320 image_view_ = new views::ImageView();
318 // Disable |image_view_| so mouse events propagate to the parent. 321 // Disable |image_view_| so mouse events propagate to the parent.
319 image_view_->SetEnabled(false); 322 image_view_->SetEnabled(false);
320 image_view_->SetImage(gray_image_); 323 image_view_->SetImage(gray_image_);
321 image_view_->SetTooltipText( 324 image_view_->SetTooltipText(
322 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY)); 325 l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_POLICY));
323 AddChildView(image_view_); 326 AddChildView(image_view_);
324 } 327 }
325 328
326 } // namespace chromeos 329 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/network_message_observer.cc ('k') | chrome/browser/chromeos/status/network_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698