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/ui/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 491 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
492 void BrowserWindowCocoa::ShowOneClickSigninBubble( | 492 void BrowserWindowCocoa::ShowOneClickSigninBubble( |
493 OneClickSigninBubbleType type, | 493 OneClickSigninBubbleType type, |
494 const string16& email, | 494 const string16& email, |
495 const string16& error_message, | 495 const string16& error_message, |
496 const StartSyncCallback& start_sync_callback) { | 496 const StartSyncCallback& start_sync_callback) { |
497 WebContents* web_contents = | 497 WebContents* web_contents = |
498 browser_->tab_strip_model()->GetActiveWebContents(); | 498 browser_->tab_strip_model()->GetActiveWebContents(); |
499 if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) { | 499 if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) { |
500 scoped_nsobject<OneClickSigninBubbleController> bubble_controller( | 500 base::scoped_nsobject<OneClickSigninBubbleController> bubble_controller([ |
501 [[OneClickSigninBubbleController alloc] | 501 [OneClickSigninBubbleController alloc] |
502 initWithBrowserWindowController:cocoa_controller() | 502 initWithBrowserWindowController:cocoa_controller() |
503 webContents:web_contents | 503 webContents:web_contents |
504 errorMessage:base::SysUTF16ToNSString( | 504 errorMessage:base::SysUTF16ToNSString(error_message) |
505 error_message) | 505 callback:start_sync_callback]); |
506 callback:start_sync_callback]); | |
507 [bubble_controller showWindow:nil]; | 506 [bubble_controller showWindow:nil]; |
508 } else { | 507 } else { |
509 // Deletes itself when the dialog closes. | 508 // Deletes itself when the dialog closes. |
510 new OneClickSigninDialogController(web_contents, start_sync_callback); | 509 new OneClickSigninDialogController(web_contents, start_sync_callback); |
511 } | 510 } |
512 } | 511 } |
513 #endif | 512 #endif |
514 | 513 |
515 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { | 514 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { |
516 return [controller_ isDownloadShelfVisible] != NO; | 515 return [controller_ isDownloadShelfVisible] != NO; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 PasswordGenerationBubbleController* controller = | 717 PasswordGenerationBubbleController* controller = |
719 [[PasswordGenerationBubbleController alloc] | 718 [[PasswordGenerationBubbleController alloc] |
720 initWithWindow:browser_->window()->GetNativeWindow() | 719 initWithWindow:browser_->window()->GetNativeWindow() |
721 anchoredAt:point | 720 anchoredAt:point |
722 renderViewHost:web_contents->GetRenderViewHost() | 721 renderViewHost:web_contents->GetRenderViewHost() |
723 passwordManager:PasswordManager::FromWebContents(web_contents) | 722 passwordManager:PasswordManager::FromWebContents(web_contents) |
724 usingGenerator:password_generator | 723 usingGenerator:password_generator |
725 forForm:form]; | 724 forForm:form]; |
726 [controller showWindow:nil]; | 725 [controller showWindow:nil]; |
727 } | 726 } |
OLD | NEW |