| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 72 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 73 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 73 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 74 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" | 74 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" |
| 75 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" | 75 #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" |
| 76 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 76 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 77 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 77 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 78 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
| 79 #include "chrome/common/extensions/command.h" | 79 #include "chrome/common/extensions/command.h" |
| 80 #include "chrome/common/url_constants.h" | 80 #include "chrome/common/url_constants.h" |
| 81 #include "components/signin/core/common/profile_management_switches.h" | 81 #include "components/signin/core/common/profile_management_switches.h" |
| 82 #include "components/translate/core/browser/translate_manager.h" |
| 82 #include "components/translate/core/browser/translate_ui_delegate.h" | 83 #include "components/translate/core/browser/translate_ui_delegate.h" |
| 83 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 84 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 84 #include "content/public/browser/render_view_host.h" | 85 #include "content/public/browser/render_view_host.h" |
| 85 #include "content/public/browser/render_widget_host_view.h" | 86 #include "content/public/browser/render_widget_host_view.h" |
| 86 #include "content/public/browser/web_contents.h" | 87 #include "content/public/browser/web_contents.h" |
| 87 #include "grit/chromium_strings.h" | 88 #include "grit/chromium_strings.h" |
| 88 #include "grit/generated_resources.h" | 89 #include "grit/generated_resources.h" |
| 89 #include "grit/locale_settings.h" | 90 #include "grit/locale_settings.h" |
| 90 #import "ui/base/cocoa/cocoa_base_utils.h" | 91 #import "ui/base/cocoa/cocoa_base_utils.h" |
| 91 #include "ui/base/l10n/l10n_util.h" | 92 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 } | 1782 } |
| 1782 return; | 1783 return; |
| 1783 } | 1784 } |
| 1784 | 1785 |
| 1785 std::string sourceLanguage; | 1786 std::string sourceLanguage; |
| 1786 std::string targetLanguage; | 1787 std::string targetLanguage; |
| 1787 ChromeTranslateClient::GetTranslateLanguages( | 1788 ChromeTranslateClient::GetTranslateLanguages( |
| 1788 contents, &sourceLanguage, &targetLanguage); | 1789 contents, &sourceLanguage, &targetLanguage); |
| 1789 | 1790 |
| 1790 scoped_ptr<TranslateUIDelegate> uiDelegate(new TranslateUIDelegate( | 1791 scoped_ptr<TranslateUIDelegate> uiDelegate(new TranslateUIDelegate( |
| 1791 ChromeTranslateClient::FromWebContents(contents), | 1792 ChromeTranslateClient::GetManagerFromWebContents(contents)->GetWeakPtr(), |
| 1792 ChromeTranslateClient::GetManagerFromWebContents(contents), | |
| 1793 sourceLanguage, | 1793 sourceLanguage, |
| 1794 targetLanguage)); | 1794 targetLanguage)); |
| 1795 scoped_ptr<TranslateBubbleModel> model( | 1795 scoped_ptr<TranslateBubbleModel> model( |
| 1796 new TranslateBubbleModelImpl(step, uiDelegate.Pass())); | 1796 new TranslateBubbleModelImpl(step, uiDelegate.Pass())); |
| 1797 translateBubbleController_ = [[TranslateBubbleController alloc] | 1797 translateBubbleController_ = [[TranslateBubbleController alloc] |
| 1798 initWithParentWindow:self | 1798 initWithParentWindow:self |
| 1799 model:model.Pass() | 1799 model:model.Pass() |
| 1800 webContents:contents]; | 1800 webContents:contents]; |
| 1801 [translateBubbleController_ showWindow:nil]; | 1801 [translateBubbleController_ showWindow:nil]; |
| 1802 | 1802 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 | 2302 |
| 2303 - (BOOL)supportsBookmarkBar { | 2303 - (BOOL)supportsBookmarkBar { |
| 2304 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2304 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 - (BOOL)isTabbedWindow { | 2307 - (BOOL)isTabbedWindow { |
| 2308 return browser_->is_type_tabbed(); | 2308 return browser_->is_type_tabbed(); |
| 2309 } | 2309 } |
| 2310 | 2310 |
| 2311 @end // @implementation BrowserWindowController(WindowType) | 2311 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |