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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 13845022: Mac: Display a native bubble (instead of the JS one) after the web signin flow. (branched from http… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ntpBubble
Patch Set: Fix bot issues Created 7 years, 8 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
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/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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 void BrowserWindowCocoa::ShowChromeToMobileBubble() { 475 void BrowserWindowCocoa::ShowChromeToMobileBubble() {
476 [controller_ showChromeToMobileBubble]; 476 [controller_ showChromeToMobileBubble];
477 } 477 }
478 478
479 #if defined(ENABLE_ONE_CLICK_SIGNIN) 479 #if defined(ENABLE_ONE_CLICK_SIGNIN)
480 void BrowserWindowCocoa::ShowOneClickSigninBubble( 480 void BrowserWindowCocoa::ShowOneClickSigninBubble(
481 OneClickSigninBubbleType type, 481 OneClickSigninBubbleType type,
482 const string16& email, 482 const string16& email,
483 const string16& error_message, 483 const string16& error_message,
484 const StartSyncCallback& start_sync_callback) { 484 const StartSyncCallback& start_sync_callback) {
485 WebContents* web_contents =
486 browser_->tab_strip_model()->GetActiveWebContents();
485 if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) { 487 if (type == ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE) {
486 scoped_nsobject<OneClickSigninBubbleController> bubble_controller( 488 scoped_nsobject<OneClickSigninBubbleController> bubble_controller(
487 [[OneClickSigninBubbleController alloc] 489 [[OneClickSigninBubbleController alloc]
488 initWithBrowserWindowController:cocoa_controller() 490 initWithBrowserWindowController:cocoa_controller()
491 webContents:web_contents
492 errorMessage:error_message
489 callback:start_sync_callback]); 493 callback:start_sync_callback]);
490 [bubble_controller showWindow:nil]; 494 [bubble_controller showWindow:nil];
491 } else { 495 } else {
492 WebContents* web_contents =
493 browser_->tab_strip_model()->GetActiveWebContents();
494 // Deletes itself when the dialog closes. 496 // Deletes itself when the dialog closes.
495 new OneClickSigninDialogController(web_contents, start_sync_callback); 497 new OneClickSigninDialogController(web_contents, start_sync_callback);
496 } 498 }
497 } 499 }
498 #endif 500 #endif
499 501
500 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { 502 bool BrowserWindowCocoa::IsDownloadShelfVisible() const {
501 return [controller_ isDownloadShelfVisible] != NO; 503 return [controller_ isDownloadShelfVisible] != NO;
502 } 504 }
503 505
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 PasswordGenerationBubbleController* controller = 704 PasswordGenerationBubbleController* controller =
703 [[PasswordGenerationBubbleController alloc] 705 [[PasswordGenerationBubbleController alloc]
704 initWithWindow:browser_->window()->GetNativeWindow() 706 initWithWindow:browser_->window()->GetNativeWindow()
705 anchoredAt:point 707 anchoredAt:point
706 renderViewHost:web_contents->GetRenderViewHost() 708 renderViewHost:web_contents->GetRenderViewHost()
707 passwordManager:PasswordManager::FromWebContents(web_contents) 709 passwordManager:PasswordManager::FromWebContents(web_contents)
708 usingGenerator:password_generator 710 usingGenerator:password_generator
709 forForm:form]; 711 forForm:form];
710 [controller showWindow:nil]; 712 [controller showWindow:nil];
711 } 713 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698