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 #ifndef CHROME_BROWSER_APP_CONTROLLER_MAC_H_ | 5 #ifndef CHROME_BROWSER_APP_CONTROLLER_MAC_H_ |
6 #define CHROME_BROWSER_APP_CONTROLLER_MAC_H_ | 6 #define CHROME_BROWSER_APP_CONTROLLER_MAC_H_ |
7 | 7 |
8 #if defined(__OBJC__) | 8 #if defined(__OBJC__) |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_nsobject.h" | 13 #include "base/memory/scoped_nsobject.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/prefs/public/pref_change_registrar.h" |
16 #include "ui/base/work_area_watcher_observer.h" | 17 #include "ui/base/work_area_watcher_observer.h" |
17 | 18 |
18 class BookmarkMenuBridge; | 19 class BookmarkMenuBridge; |
19 class CommandUpdater; | 20 class CommandUpdater; |
20 class GURL; | 21 class GURL; |
21 class HistoryMenuBridge; | 22 class HistoryMenuBridge; |
22 class Profile; | 23 class Profile; |
23 @class ProfileMenuController; | 24 @class ProfileMenuController; |
24 namespace ui { | 25 namespace ui { |
25 class WorkAreaWatcherObserver; | 26 class WorkAreaWatcherObserver; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 IBOutlet NSMenu* helpMenu_; | 66 IBOutlet NSMenu* helpMenu_; |
66 | 67 |
67 // Outlet for the tabpose menu item so we can hide it. | 68 // Outlet for the tabpose menu item so we can hide it. |
68 IBOutlet NSMenuItem* tabposeMenuItem_; | 69 IBOutlet NSMenuItem* tabposeMenuItem_; |
69 | 70 |
70 // Indicates wheter an NSPopover is currently being shown. | 71 // Indicates wheter an NSPopover is currently being shown. |
71 BOOL hasPopover_; | 72 BOOL hasPopover_; |
72 | 73 |
73 // Observers that listen to the work area changes. | 74 // Observers that listen to the work area changes. |
74 ObserverList<ui::WorkAreaWatcherObserver> workAreaChangeObservers_; | 75 ObserverList<ui::WorkAreaWatcherObserver> workAreaChangeObservers_; |
| 76 |
| 77 scoped_ptr<PrefChangeRegistrar> profilePrefRegistrar_; |
| 78 PrefChangeRegistrar localPrefRegistrar_; |
75 } | 79 } |
76 | 80 |
77 @property(readonly, nonatomic) BOOL startupComplete; | 81 @property(readonly, nonatomic) BOOL startupComplete; |
78 @property(readonly, nonatomic) Profile* lastProfile; | 82 @property(readonly, nonatomic) Profile* lastProfile; |
79 | 83 |
80 - (void)didEndMainMessageLoop; | 84 - (void)didEndMainMessageLoop; |
81 | 85 |
82 // Try to close all browser windows, and if that succeeds then quit. | 86 // Try to close all browser windows, and if that succeeds then quit. |
83 - (BOOL)tryToTerminateApplication:(NSApplication*)app; | 87 - (BOOL)tryToTerminateApplication:(NSApplication*)app; |
84 | 88 |
85 // Stop trying to terminate the application. That is, prevent the final browser | 89 // Stop trying to terminate the application. That is, prevent the final browser |
86 // window closure from causing the application to quit. | 90 // window closure from causing the application to quit. |
87 - (void)stopTryingToTerminateApplication:(NSApplication*)app; | 91 - (void)stopTryingToTerminateApplication:(NSApplication*)app; |
88 | 92 |
89 // Returns true if there is not a modal window (either window- or application- | 93 // Returns true if there is a modal window (either window- or application- |
90 // modal) blocking the active browser. Note that tab modal dialogs (HTTP auth | 94 // modal) blocking the active browser. Note that tab modal dialogs (HTTP auth |
91 // sheets) will not count as blocking the browser. But things like open/save | 95 // sheets) will not count as blocking the browser. But things like open/save |
92 // dialogs that are window modal will block the browser. | 96 // dialogs that are window modal will block the browser. |
93 - (BOOL)keyWindowIsNotModal; | 97 - (BOOL)keyWindowIsModal; |
94 | 98 |
95 // Show the preferences window, or bring it to the front if it's already | 99 // Show the preferences window, or bring it to the front if it's already |
96 // visible. | 100 // visible. |
97 - (IBAction)showPreferences:(id)sender; | 101 - (IBAction)showPreferences:(id)sender; |
98 | 102 |
99 // Redirect in the menu item from the expected target of "File's | 103 // Redirect in the menu item from the expected target of "File's |
100 // Owner" (NSAppliation) for a Branded About Box | 104 // Owner" (NSAppliation) for a Branded About Box |
101 - (IBAction)orderFrontStandardAboutPanel:(id)sender; | 105 - (IBAction)orderFrontStandardAboutPanel:(id)sender; |
102 | 106 |
103 // Toggles the "Confirm to Quit" preference. | 107 // Toggles the "Confirm to Quit" preference. |
(...skipping 23 matching lines...) Expand all Loading... |
127 namespace app_controller_mac { | 131 namespace app_controller_mac { |
128 | 132 |
129 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in | 133 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in |
130 // SessionService::Observe() to get around windows/linux and mac having | 134 // SessionService::Observe() to get around windows/linux and mac having |
131 // different models of application lifetime. | 135 // different models of application lifetime. |
132 bool IsOpeningNewWindow(); | 136 bool IsOpeningNewWindow(); |
133 | 137 |
134 } // namespace app_controller_mac | 138 } // namespace app_controller_mac |
135 | 139 |
136 #endif | 140 #endif |
OLD | NEW |