| 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 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 callback.Run(false, web_app_info); | 612 callback.Run(false, web_app_info); |
| 613 } | 613 } |
| 614 | 614 |
| 615 autofill::SaveCardBubbleView* BrowserWindowCocoa::ShowSaveCreditCardBubble( | 615 autofill::SaveCardBubbleView* BrowserWindowCocoa::ShowSaveCreditCardBubble( |
| 616 content::WebContents* web_contents, | 616 content::WebContents* web_contents, |
| 617 autofill::SaveCardBubbleController* controller, | 617 autofill::SaveCardBubbleController* controller, |
| 618 bool user_gesture) { | 618 bool user_gesture) { |
| 619 return new autofill::SaveCardBubbleViewBridge(controller, controller_); | 619 return new autofill::SaveCardBubbleViewBridge(controller, controller_); |
| 620 } | 620 } |
| 621 | 621 |
| 622 void BrowserWindowCocoa::ShowTranslateBubble( | 622 ShowTranslateBubbleResult BrowserWindowCocoa::ShowTranslateBubble( |
| 623 content::WebContents* contents, | 623 content::WebContents* contents, |
| 624 translate::TranslateStep step, | 624 translate::TranslateStep step, |
| 625 translate::TranslateErrors::Type error_type, | 625 translate::TranslateErrors::Type error_type, |
| 626 bool is_user_gesture) { | 626 bool is_user_gesture) { |
| 627 ChromeTranslateClient* chrome_translate_client = | 627 ChromeTranslateClient* chrome_translate_client = |
| 628 ChromeTranslateClient::FromWebContents(contents); | 628 ChromeTranslateClient::FromWebContents(contents); |
| 629 translate::LanguageState& language_state = | 629 translate::LanguageState& language_state = |
| 630 chrome_translate_client->GetLanguageState(); | 630 chrome_translate_client->GetLanguageState(); |
| 631 language_state.SetTranslateEnabled(true); | 631 language_state.SetTranslateEnabled(true); |
| 632 | 632 |
| 633 [controller_ showTranslateBubbleForWebContents:contents | 633 [controller_ showTranslateBubbleForWebContents:contents |
| 634 step:step | 634 step:step |
| 635 errorType:error_type]; | 635 errorType:error_type]; |
| 636 |
| 637 return ShowTranslateBubbleResult::SUCCESS; |
| 636 } | 638 } |
| 637 | 639 |
| 638 #if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) | 640 #if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) |
| 639 void BrowserWindowCocoa::ShowOneClickSigninConfirmation( | 641 void BrowserWindowCocoa::ShowOneClickSigninConfirmation( |
| 640 const base::string16& email, | 642 const base::string16& email, |
| 641 const StartSyncCallback& start_sync_callback) { | 643 const StartSyncCallback& start_sync_callback) { |
| 642 // Deletes itself when the dialog closes. | 644 // Deletes itself when the dialog closes. |
| 643 new OneClickSigninDialogController( | 645 new OneClickSigninDialogController( |
| 644 browser_->tab_strip_model()->GetActiveWebContents(), start_sync_callback, | 646 browser_->tab_strip_model()->GetActiveWebContents(), start_sync_callback, |
| 645 email); | 647 email); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { | 832 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { |
| 831 return [controller_ exclusiveAccessController]; | 833 return [controller_ exclusiveAccessController]; |
| 832 } | 834 } |
| 833 | 835 |
| 834 void BrowserWindowCocoa::ShowImeWarningBubble( | 836 void BrowserWindowCocoa::ShowImeWarningBubble( |
| 835 const extensions::Extension* extension, | 837 const extensions::Extension* extension, |
| 836 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& | 838 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& |
| 837 callback) { | 839 callback) { |
| 838 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; | 840 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; |
| 839 } | 841 } |
| OLD | NEW |