| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 void BrowserWindowCocoa::ShowChromeToMobileBubble() { | 479 void BrowserWindowCocoa::ShowChromeToMobileBubble() { |
| 480 [controller_ showChromeToMobileBubble]; | 480 [controller_ showChromeToMobileBubble]; |
| 481 } | 481 } |
| 482 | 482 |
| 483 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 483 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 484 void BrowserWindowCocoa::ShowOneClickSigninBubble( | 484 void BrowserWindowCocoa::ShowOneClickSigninBubble( |
| 485 OneClickSigninBubbleType type, | 485 OneClickSigninBubbleType type, |
| 486 const string16& email, | 486 const string16& email, |
| 487 const string16& error_message, | 487 const string16& error_message, |
| 488 const StartSyncCallback& start_sync_callback) { | 488 const StartSyncCallback& start_sync_callback) { |
| 489 WebContents* web_contents = |
| 490 browser_->tab_strip_model()->GetActiveWebContents(); |
| 489 if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) { | 491 if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) { |
| 490 scoped_nsobject<OneClickSigninBubbleController> bubble_controller( | 492 scoped_nsobject<OneClickSigninBubbleController> bubble_controller( |
| 491 [[OneClickSigninBubbleController alloc] | 493 [[OneClickSigninBubbleController alloc] |
| 492 initWithBrowserWindowController:cocoa_controller() | 494 initWithBrowserWindowController:cocoa_controller() |
| 495 webContents:web_contents |
| 496 errorMessage:base::SysUTF16ToNSString( |
| 497 error_message) |
| 493 callback:start_sync_callback]); | 498 callback:start_sync_callback]); |
| 494 [bubble_controller showWindow:nil]; | 499 [bubble_controller showWindow:nil]; |
| 495 } else { | 500 } else { |
| 496 WebContents* web_contents = | |
| 497 browser_->tab_strip_model()->GetActiveWebContents(); | |
| 498 // Deletes itself when the dialog closes. | 501 // Deletes itself when the dialog closes. |
| 499 new OneClickSigninDialogController(web_contents, start_sync_callback); | 502 new OneClickSigninDialogController(web_contents, start_sync_callback); |
| 500 } | 503 } |
| 501 } | 504 } |
| 502 #endif | 505 #endif |
| 503 | 506 |
| 504 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { | 507 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { |
| 505 return [controller_ isDownloadShelfVisible] != NO; | 508 return [controller_ isDownloadShelfVisible] != NO; |
| 506 } | 509 } |
| 507 | 510 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 PasswordGenerationBubbleController* controller = | 709 PasswordGenerationBubbleController* controller = |
| 707 [[PasswordGenerationBubbleController alloc] | 710 [[PasswordGenerationBubbleController alloc] |
| 708 initWithWindow:browser_->window()->GetNativeWindow() | 711 initWithWindow:browser_->window()->GetNativeWindow() |
| 709 anchoredAt:point | 712 anchoredAt:point |
| 710 renderViewHost:web_contents->GetRenderViewHost() | 713 renderViewHost:web_contents->GetRenderViewHost() |
| 711 passwordManager:PasswordManager::FromWebContents(web_contents) | 714 passwordManager:PasswordManager::FromWebContents(web_contents) |
| 712 usingGenerator:password_generator | 715 usingGenerator:password_generator |
| 713 forForm:form]; | 716 forForm:form]; |
| 714 [controller showWindow:nil]; | 717 [controller showWindow:nil]; |
| 715 } | 718 } |
| OLD | NEW |