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 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
6 | 6 |
7 #include "apps/app_shim/app_shim_mac.h" | 7 #include "apps/app_shim/app_shim_mac.h" |
8 #include "apps/app_shim/extension_app_shim_handler_mac.h" | 8 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
9 #include "apps/shell_window_registry.h" | 9 #include "apps/shell_window_registry.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 DCHECK(profile_manager_); | 225 DCHECK(profile_manager_); |
226 profile_manager_->GetProfileInfoCache().RemoveObserver(this); | 226 profile_manager_->GetProfileInfoCache().RemoveObserver(this); |
227 } | 227 } |
228 | 228 |
229 private: | 229 private: |
230 // ProfileInfoCacheObserver implementation: | 230 // ProfileInfoCacheObserver implementation: |
231 | 231 |
232 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE { | 232 virtual void OnProfileAdded(const base::FilePath& profile_path) OVERRIDE { |
233 } | 233 } |
234 | 234 |
235 virtual void OnProfileWasRemoved(const base::FilePath& profile_path, | 235 virtual void OnProfileWasRemoved( |
236 const string16& profile_name) OVERRIDE { | 236 const base::FilePath& profile_path, |
| 237 const base::string16& profile_name) OVERRIDE { |
237 // When a profile is deleted we need to notify the AppController, | 238 // When a profile is deleted we need to notify the AppController, |
238 // so it can correctly update its pointer to the last used profile. | 239 // so it can correctly update its pointer to the last used profile. |
239 [app_controller_ profileWasRemoved:profile_path]; | 240 [app_controller_ profileWasRemoved:profile_path]; |
240 } | 241 } |
241 | 242 |
242 virtual void OnProfileWillBeRemoved( | 243 virtual void OnProfileWillBeRemoved( |
243 const base::FilePath& profile_path) OVERRIDE { | 244 const base::FilePath& profile_path) OVERRIDE { |
244 } | 245 } |
245 | 246 |
246 virtual void OnProfileNameChanged(const base::FilePath& profile_path, | 247 virtual void OnProfileNameChanged( |
247 const string16& old_profile_name) OVERRIDE { | 248 const base::FilePath& profile_path, |
| 249 const base::string16& old_profile_name) OVERRIDE { |
248 } | 250 } |
249 | 251 |
250 virtual void OnProfileAvatarChanged( | 252 virtual void OnProfileAvatarChanged( |
251 const base::FilePath& profile_path) OVERRIDE { | 253 const base::FilePath& profile_path) OVERRIDE { |
252 } | 254 } |
253 | 255 |
254 ProfileManager* profile_manager_; | 256 ProfileManager* profile_manager_; |
255 | 257 |
256 AppController* app_controller_; // Weak; owns us. | 258 AppController* app_controller_; // Weak; owns us. |
257 | 259 |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 NSAppleEventDescriptor* paramList = | 1311 NSAppleEventDescriptor* paramList = |
1310 [event paramDescriptorForKeyword:cloud_print::kAECloudPrintClass]; | 1312 [event paramDescriptorForKeyword:cloud_print::kAECloudPrintClass]; |
1311 | 1313 |
1312 if (paramList != nil) { | 1314 if (paramList != nil) { |
1313 // Pull required fields out of parameter list. | 1315 // Pull required fields out of parameter list. |
1314 NSString* mime = [[paramList descriptorAtIndex:1] stringValue]; | 1316 NSString* mime = [[paramList descriptorAtIndex:1] stringValue]; |
1315 NSString* inputPath = [[paramList descriptorAtIndex:2] stringValue]; | 1317 NSString* inputPath = [[paramList descriptorAtIndex:2] stringValue]; |
1316 NSString* printTitle = [[paramList descriptorAtIndex:3] stringValue]; | 1318 NSString* printTitle = [[paramList descriptorAtIndex:3] stringValue]; |
1317 NSString* printTicket = [[paramList descriptorAtIndex:4] stringValue]; | 1319 NSString* printTicket = [[paramList descriptorAtIndex:4] stringValue]; |
1318 // Convert the title to UTF 16 as required. | 1320 // Convert the title to UTF 16 as required. |
1319 string16 title16 = base::SysNSStringToUTF16(printTitle); | 1321 base::string16 title16 = base::SysNSStringToUTF16(printTitle); |
1320 string16 printTicket16 = base::SysNSStringToUTF16(printTicket); | 1322 base::string16 printTicket16 = base::SysNSStringToUTF16(printTicket); |
1321 print_dialog_cloud::CreatePrintDialogForFile( | 1323 print_dialog_cloud::CreatePrintDialogForFile( |
1322 ProfileManager::GetDefaultProfile(), NULL, | 1324 ProfileManager::GetDefaultProfile(), NULL, |
1323 base::FilePath([inputPath UTF8String]), title16, | 1325 base::FilePath([inputPath UTF8String]), title16, |
1324 printTicket16, [mime UTF8String], /*delete_on_close=*/false); | 1326 printTicket16, [mime UTF8String], /*delete_on_close=*/false); |
1325 } | 1327 } |
1326 } | 1328 } |
1327 | 1329 |
1328 - (void)application:(NSApplication*)sender | 1330 - (void)application:(NSApplication*)sender |
1329 openFiles:(NSArray*)filenames { | 1331 openFiles:(NSArray*)filenames { |
1330 std::vector<GURL> gurlVector; | 1332 std::vector<GURL> gurlVector; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 | 1483 |
1482 //--------------------------------------------------------------------------- | 1484 //--------------------------------------------------------------------------- |
1483 | 1485 |
1484 namespace app_controller_mac { | 1486 namespace app_controller_mac { |
1485 | 1487 |
1486 bool IsOpeningNewWindow() { | 1488 bool IsOpeningNewWindow() { |
1487 return g_is_opening_new_window; | 1489 return g_is_opening_new_window; |
1488 } | 1490 } |
1489 | 1491 |
1490 } // namespace app_controller_mac | 1492 } // namespace app_controller_mac |
OLD | NEW |