| 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" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/sys_string_conversions.h" | 13 #include "base/strings/sys_string_conversions.h" |
| 14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/download/download_shelf.h" | 16 #include "chrome/browser/download/download_shelf.h" |
| 17 #include "chrome/browser/extensions/extension_util.h" | 17 #include "chrome/browser/extensions/extension_util.h" |
| 18 #include "chrome/browser/extensions/tab_helper.h" | 18 #include "chrome/browser/extensions/tab_helper.h" |
| 19 #include "chrome/browser/metrics/browser_window_histogram_helper.h" | 19 #include "chrome/browser/metrics/browser_window_histogram_helper.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/profiles/profile_window.h" | 21 #include "chrome/browser/profiles/profile_window.h" |
| 22 #include "chrome/browser/shell_integration.h" | 22 #include "chrome/browser/shell_integration.h" |
| 23 #include "chrome/browser/signin/chrome_signin_helper.h" | 23 #include "chrome/browser/signin/chrome_signin_helper.h" |
| 24 #include "chrome/browser/translate/chrome_translate_client.h" | 24 #include "chrome/browser/translate/chrome_translate_client.h" |
| 25 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/browser/ui/browser_command_controller.h" | 27 #include "chrome/browser/ui/browser_command_controller.h" |
| 27 #include "chrome/browser/ui/browser_commands.h" | 28 #include "chrome/browser/ui/browser_commands.h" |
| 28 #include "chrome/browser/ui/browser_dialogs.h" | 29 #include "chrome/browser/ui/browser_dialogs.h" |
| 29 #include "chrome/browser/ui/browser_list.h" | 30 #include "chrome/browser/ui/browser_list.h" |
| 30 #include "chrome/browser/ui/browser_window_state.h" | 31 #include "chrome/browser/ui/browser_window_state.h" |
| 31 #import "chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.h" | 32 #import "chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.h" |
| 32 #import "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h" | 33 #import "chrome/browser/ui/cocoa/browser/exclusive_access_controller_views.h" |
| 33 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 34 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 34 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 35 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 withMode:mode | 838 withMode:mode |
| 838 withServiceType:manage_accounts_params.service_type | 839 withServiceType:manage_accounts_params.service_type |
| 839 fromAccessPoint:access_point]; | 840 fromAccessPoint:access_point]; |
| 840 } | 841 } |
| 841 } | 842 } |
| 842 | 843 |
| 843 int | 844 int |
| 844 BrowserWindowCocoa::GetRenderViewHeightInsetWithDetachedBookmarkBar() { | 845 BrowserWindowCocoa::GetRenderViewHeightInsetWithDetachedBookmarkBar() { |
| 845 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) | 846 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) |
| 846 return 0; | 847 return 0; |
| 847 return 40; | 848 return chrome::kNTPBookmarkBarHeight; |
| 848 } | 849 } |
| 849 | 850 |
| 850 void BrowserWindowCocoa::ExecuteExtensionCommand( | 851 void BrowserWindowCocoa::ExecuteExtensionCommand( |
| 851 const extensions::Extension* extension, | 852 const extensions::Extension* extension, |
| 852 const extensions::Command& command) { | 853 const extensions::Command& command) { |
| 853 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; | 854 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; |
| 854 } | 855 } |
| 855 | 856 |
| 856 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { | 857 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { |
| 857 return [controller_ exclusiveAccessController]; | 858 return [controller_ exclusiveAccessController]; |
| 858 } | 859 } |
| 859 | 860 |
| 860 void BrowserWindowCocoa::ShowImeWarningBubble( | 861 void BrowserWindowCocoa::ShowImeWarningBubble( |
| 861 const extensions::Extension* extension, | 862 const extensions::Extension* extension, |
| 862 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& | 863 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& |
| 863 callback) { | 864 callback) { |
| 864 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; | 865 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; |
| 865 } | 866 } |
| OLD | NEW |