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 29 matching lines...) Expand all Loading... |
40 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
41 #include "content/public/browser/notification_source.h" | 41 #include "content/public/browser/notification_source.h" |
42 #include "content/public/browser/native_web_keyboard_event.h" | 42 #include "content/public/browser/native_web_keyboard_event.h" |
43 #include "content/public/browser/notification_details.h" | 43 #include "content/public/browser/notification_details.h" |
44 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
45 #include "grit/chromium_strings.h" | 45 #include "grit/chromium_strings.h" |
46 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
47 #include "ui/base/l10n/l10n_util_mac.h" | 47 #include "ui/base/l10n/l10n_util_mac.h" |
48 #include "ui/gfx/rect.h" | 48 #include "ui/gfx/rect.h" |
49 | 49 |
| 50 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 51 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" |
| 52 #endif |
| 53 |
50 using content::SSLStatus; | 54 using content::SSLStatus; |
51 using content::WebContents; | 55 using content::WebContents; |
52 | 56 |
53 // Replicate specific 10.7 SDK declarations for building with prior SDKs. | 57 // Replicate specific 10.7 SDK declarations for building with prior SDKs. |
54 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 58 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
55 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 59 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
56 | 60 |
57 enum { | 61 enum { |
58 NSWindowAnimationBehaviorDefault = 0, | 62 NSWindowAnimationBehaviorDefault = 0, |
59 NSWindowAnimationBehaviorNone = 2, | 63 NSWindowAnimationBehaviorNone = 2, |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 bool already_bookmarked) { | 447 bool already_bookmarked) { |
444 [controller_ showBookmarkBubbleForURL:url | 448 [controller_ showBookmarkBubbleForURL:url |
445 alreadyBookmarked:(already_bookmarked ? YES : NO)]; | 449 alreadyBookmarked:(already_bookmarked ? YES : NO)]; |
446 } | 450 } |
447 | 451 |
448 void BrowserWindowCocoa::ShowChromeToMobileBubble() { | 452 void BrowserWindowCocoa::ShowChromeToMobileBubble() { |
449 [controller_ showChromeToMobileBubble]; | 453 [controller_ showChromeToMobileBubble]; |
450 } | 454 } |
451 | 455 |
452 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 456 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
453 void BrowserWindowCocoa::ShowOneClickSigninBubble() { | 457 |
454 NOTIMPLEMENTED(); | 458 void BrowserWindowCocoa::ShowOneClickSigninBubble( |
| 459 const base::Closure& learn_more_callback, |
| 460 const base::Closure& advanced_callback) { |
| 461 OneClickSigninBubbleController* bubble_controller = |
| 462 [[OneClickSigninBubbleController alloc] |
| 463 initWithBrowserWindowController:cocoa_controller() |
| 464 learnMoreCallback:learn_more_callback |
| 465 advancedCallback:advanced_callback]; |
| 466 [bubble_controller showWindow:nil]; |
455 } | 467 } |
456 #endif | 468 #endif |
457 | 469 |
458 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { | 470 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { |
459 return [controller_ isDownloadShelfVisible] != NO; | 471 return [controller_ isDownloadShelfVisible] != NO; |
460 } | 472 } |
461 | 473 |
462 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { | 474 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { |
463 DownloadShelfController* shelfController = [controller_ downloadShelf]; | 475 DownloadShelfController* shelfController = [controller_ downloadShelf]; |
464 return [shelfController bridge]; | 476 return [shelfController bridge]; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 AvatarMenuBubbleController* menu = | 663 AvatarMenuBubbleController* menu = |
652 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 664 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
653 anchoredAt:point]; | 665 anchoredAt:point]; |
654 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 666 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
655 [menu showWindow:nil]; | 667 [menu showWindow:nil]; |
656 } | 668 } |
657 | 669 |
658 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 670 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
659 [[controller_ avatarButtonController] showAvatarBubble]; | 671 [[controller_ avatarButtonController] showAvatarBubble]; |
660 } | 672 } |
OLD | NEW |