| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 42 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
| 43 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 43 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 44 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" | 44 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" |
| 45 #import "chrome/browser/ui/cocoa/website_settings_bubble_controller.h" | 45 #import "chrome/browser/ui/cocoa/website_settings_bubble_controller.h" |
| 46 #include "chrome/browser/ui/search/search_model.h" | 46 #include "chrome/browser/ui/search/search_model.h" |
| 47 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 47 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 48 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 48 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 49 #include "chrome/browser/web_applications/web_app.h" | 49 #include "chrome/browser/web_applications/web_app.h" |
| 50 #include "chrome/common/chrome_switches.h" | 50 #include "chrome/common/chrome_switches.h" |
| 51 #include "chrome/common/pref_names.h" | 51 #include "chrome/common/pref_names.h" |
| 52 #include "components/autofill/core/common/password_form.h" |
| 52 #include "content/public/browser/native_web_keyboard_event.h" | 53 #include "content/public/browser/native_web_keyboard_event.h" |
| 53 #include "content/public/browser/notification_details.h" | 54 #include "content/public/browser/notification_details.h" |
| 54 #include "content/public/browser/notification_source.h" | 55 #include "content/public/browser/notification_source.h" |
| 55 #include "content/public/browser/web_contents.h" | 56 #include "content/public/browser/web_contents.h" |
| 56 #include "content/public/browser/web_contents_view.h" | 57 #include "content/public/browser/web_contents_view.h" |
| 57 #include "content/public/common/password_form.h" | |
| 58 #include "grit/chromium_strings.h" | 58 #include "grit/chromium_strings.h" |
| 59 #include "grit/generated_resources.h" | 59 #include "grit/generated_resources.h" |
| 60 #include "ui/base/l10n/l10n_util_mac.h" | 60 #include "ui/base/l10n/l10n_util_mac.h" |
| 61 #include "ui/gfx/rect.h" | 61 #include "ui/gfx/rect.h" |
| 62 | 62 |
| 63 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 63 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 64 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" | 64 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" |
| 65 #import "chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h" | 65 #import "chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h" |
| 66 #endif | 66 #endif |
| 67 | 67 |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 [menu showWindow:nil]; | 706 [menu showWindow:nil]; |
| 707 } | 707 } |
| 708 | 708 |
| 709 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 709 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
| 710 AvatarButtonController* controller = [controller_ avatarButtonController]; | 710 AvatarButtonController* controller = [controller_ avatarButtonController]; |
| 711 [controller showAvatarBubble:[controller buttonView]]; | 711 [controller showAvatarBubble:[controller buttonView]]; |
| 712 } | 712 } |
| 713 | 713 |
| 714 void BrowserWindowCocoa::ShowPasswordGenerationBubble( | 714 void BrowserWindowCocoa::ShowPasswordGenerationBubble( |
| 715 const gfx::Rect& rect, | 715 const gfx::Rect& rect, |
| 716 const content::PasswordForm& form, | 716 const autofill::PasswordForm& form, |
| 717 autofill::PasswordGenerator* password_generator) { | 717 autofill::PasswordGenerator* password_generator) { |
| 718 WebContents* web_contents = | 718 WebContents* web_contents = |
| 719 browser_->tab_strip_model()->GetActiveWebContents(); | 719 browser_->tab_strip_model()->GetActiveWebContents(); |
| 720 // We want to point to the middle of the rect instead of the right side. | 720 // We want to point to the middle of the rect instead of the right side. |
| 721 NSPoint point = GetPointForBubble(web_contents, | 721 NSPoint point = GetPointForBubble(web_contents, |
| 722 rect.x() + rect.width()/2, | 722 rect.x() + rect.width()/2, |
| 723 rect.bottom()); | 723 rect.bottom()); |
| 724 | 724 |
| 725 PasswordGenerationBubbleController* controller = | 725 PasswordGenerationBubbleController* controller = |
| 726 [[PasswordGenerationBubbleController alloc] | 726 [[PasswordGenerationBubbleController alloc] |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 // further, both by another H, i.e. WebContentsView's height becomes | 762 // further, both by another H, i.e. WebContentsView's height becomes |
| 763 // A.height() + H and RenderWidgetHostView's height becomes A.height() + 2H. | 763 // A.height() + H and RenderWidgetHostView's height becomes A.height() + 2H. |
| 764 // Strangely, the RenderWidgetHostView for the previous navigation entry also | 764 // Strangely, the RenderWidgetHostView for the previous navigation entry also |
| 765 // gets enlarged by H. | 765 // gets enlarged by H. |
| 766 // I believe these "automatic" resizing are caused by setAutoresizingMask of | 766 // I believe these "automatic" resizing are caused by setAutoresizingMask of |
| 767 // of the cocoa view in WebContentsViewMac, which defeats the purpose of | 767 // of the cocoa view in WebContentsViewMac, which defeats the purpose of |
| 768 // WebContentsDelegate::GetSizeForNewRenderView i.e. to prevent resizing of | 768 // WebContentsDelegate::GetSizeForNewRenderView i.e. to prevent resizing of |
| 769 // RenderWidgetHostView in (2) and (3). | 769 // RenderWidgetHostView in (2) and (3). |
| 770 return 0; | 770 return 0; |
| 771 } | 771 } |
| OLD | NEW |