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

Side by Side Diff: chrome/browser/ui/views/ash/chrome_shell_delegate.cc

Issue 9788001: Remove stops_event_propagation from Window, since it's broken. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « chrome/browser/ui/views/ash/chrome_shell_delegate.h ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/views/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h"
6 6
7 #include "ash/launcher/launcher_types.h" 7 #include "ash/launcher/launcher_types.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/wm/partial_screenshot_view.h" 9 #include "ash/wm/partial_screenshot_view.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/chromeos/login/screen_locker.h"
12 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_list.h" 15 #include "chrome/browser/ui/browser_list.h"
14 #include "chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h" 16 #include "chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h"
15 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h" 17 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h"
16 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" 18 #include "chrome/browser/ui/views/ash/status_area_host_aura.h"
17 #include "chrome/browser/ui/views/frame/browser_view.h" 19 #include "chrome/browser/ui/views/frame/browser_view.h"
18 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
19 #include "ui/aura/window.h" 21 #include "ui/aura/window.h"
20 22
21 #if defined(OS_CHROMEOS) 23 #if defined(OS_CHROMEOS)
(...skipping 16 matching lines...) Expand all
38 return windows; 40 return windows;
39 } 41 }
40 42
41 } // namespace 43 } // namespace
42 44
43 // static 45 // static
44 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL; 46 ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL;
45 47
46 ChromeShellDelegate::ChromeShellDelegate() { 48 ChromeShellDelegate::ChromeShellDelegate() {
47 instance_ = this; 49 instance_ = this;
50 g_browser_process->AddRefModule();
sky 2012/03/21 22:26:26 Remove this.
48 } 51 }
49 52
50 ChromeShellDelegate::~ChromeShellDelegate() { 53 ChromeShellDelegate::~ChromeShellDelegate() {
51 if (instance_ == this) 54 if (instance_ == this)
52 instance_ = NULL; 55 instance_ = NULL;
53 } 56 }
54 57
55 StatusAreaView* ChromeShellDelegate::GetStatusArea() { 58 StatusAreaView* ChromeShellDelegate::GetStatusArea() {
56 return status_area_host_->GetStatusArea(); 59 return status_area_host_->GetStatusArea();
57 } 60 }
58 61
59 views::Widget* ChromeShellDelegate::CreateStatusArea() { 62 views::Widget* ChromeShellDelegate::CreateStatusArea() {
60 status_area_host_.reset(new StatusAreaHostAura()); 63 status_area_host_.reset(new StatusAreaHostAura());
61 views::Widget* status_area_widget = 64 views::Widget* status_area_widget =
62 status_area_host_.get()->CreateStatusArea(); 65 status_area_host_.get()->CreateStatusArea();
63 return status_area_widget; 66 return status_area_widget;
64 } 67 }
65 68
69 void ChromeShellDelegate::LockScreen() {
66 #if defined(OS_CHROMEOS) 70 #if defined(OS_CHROMEOS)
67 void ChromeShellDelegate::LockScreen() {
68 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { 71 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) {
69 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 72 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
70 NotifyScreenLockRequested(); 73 NotifyScreenLockRequested();
71 } 74 }
75 #endif
72 } 76 }
77
78 void ChromeShellDelegate::UnlockScreen() {
79 // This is used only for testing thus far.
80 NOTIMPLEMENTED();
81 }
82
83 bool ChromeShellDelegate::IsScreenLocked() const {
84 #if defined(OS_CHROMEOS)
85 return chromeos::ScreenLocker::default_screen_locker()->locked();
86 #else
87 return false;
73 #endif 88 #endif
89 }
74 90
75 void ChromeShellDelegate::Exit() { 91 void ChromeShellDelegate::Exit() {
76 BrowserList::AttemptUserExit(); 92 BrowserList::AttemptUserExit();
77 } 93 }
78 94
79 ash::AppListViewDelegate* 95 ash::AppListViewDelegate*
80 ChromeShellDelegate::CreateAppListViewDelegate() { 96 ChromeShellDelegate::CreateAppListViewDelegate() {
81 // Shell will own the created delegate. 97 // Shell will own the created delegate.
82 return new AppListViewDelegate; 98 return new AppListViewDelegate;
83 } 99 }
(...skipping 18 matching lines...) Expand all
102 } 118 }
103 119
104 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate( 120 ash::SystemTrayDelegate* ChromeShellDelegate::CreateSystemTrayDelegate(
105 ash::SystemTray* tray) { 121 ash::SystemTray* tray) {
106 #if defined(OS_CHROMEOS) 122 #if defined(OS_CHROMEOS)
107 return chromeos::CreateSystemTrayDelegate(tray); 123 return chromeos::CreateSystemTrayDelegate(tray);
108 #else 124 #else
109 return NULL; 125 return NULL;
110 #endif 126 #endif
111 } 127 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/chrome_shell_delegate.h ('k') | ui/aura/aura.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698