| 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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
| 16 #include "chrome/app/chrome_dll_resource.h" | 16 #include "chrome/app/chrome_dll_resource.h" |
| 17 #include "chrome/browser/accessibility/invert_bubble_views.h" | 17 #include "chrome/browser/accessibility/invert_bubble_views.h" |
| 18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 19 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" | 19 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" |
| 20 #include "chrome/browser/bookmarks/bookmark_utils.h" | 20 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/debugger/devtools_window.h" | 22 #include "chrome/browser/debugger/devtools_window.h" |
| 23 #include "chrome/browser/extensions/extension_tab_helper.h" | 23 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 24 #include "chrome/browser/instant/instant_controller.h" | 24 #include "chrome/browser/instant/instant_controller.h" |
| 25 #include "chrome/browser/managed_mode.h" |
| 25 #include "chrome/browser/native_window_notification_source.h" | 26 #include "chrome/browser/native_window_notification_source.h" |
| 26 #include "chrome/browser/ntp_background_util.h" | 27 #include "chrome/browser/ntp_background_util.h" |
| 27 #include "chrome/browser/managed_mode.h" | |
| 28 #include "chrome/browser/prefs/pref_service.h" | 28 #include "chrome/browser/prefs/pref_service.h" |
| 29 #include "chrome/browser/profiles/avatar_menu_model.h" | 29 #include "chrome/browser/profiles/avatar_menu_model.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/profiles/profile_info_cache.h" | 31 #include "chrome/browser/profiles/profile_info_cache.h" |
| 32 #include "chrome/browser/profiles/profile_manager.h" | 32 #include "chrome/browser/profiles/profile_manager.h" |
| 33 #include "chrome/browser/sessions/tab_restore_service.h" | 33 #include "chrome/browser/sessions/tab_restore_service.h" |
| 34 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 34 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 35 #include "chrome/browser/speech/extension_api/tts_extension_api.h" | 35 #include "chrome/browser/speech/extension_api/tts_extension_api.h" |
| 36 #include "chrome/browser/tabs/tab_strip_model.h" | 36 #include "chrome/browser/tabs/tab_strip_model.h" |
| 37 #include "chrome/browser/themes/theme_service.h" | 37 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 ToolbarSizeChanged(false); | 1085 ToolbarSizeChanged(false); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 bool BrowserView::IsDownloadShelfVisible() const { | 1088 bool BrowserView::IsDownloadShelfVisible() const { |
| 1089 return download_shelf_.get() && download_shelf_->IsShowing(); | 1089 return download_shelf_.get() && download_shelf_->IsShowing(); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 DownloadShelf* BrowserView::GetDownloadShelf() { | 1092 DownloadShelf* BrowserView::GetDownloadShelf() { |
| 1093 if (!download_shelf_.get()) { | 1093 if (!download_shelf_.get()) { |
| 1094 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); | 1094 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); |
| 1095 download_shelf_->set_parent_owned(false); | 1095 download_shelf_->set_owned_by_client(); |
| 1096 } | 1096 } |
| 1097 return download_shelf_.get(); | 1097 return download_shelf_.get(); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 void BrowserView::ConfirmBrowserCloseWithPendingDownloads() { | 1100 void BrowserView::ConfirmBrowserCloseWithPendingDownloads() { |
| 1101 DownloadInProgressDialogView::Show(browser_.get(), GetNativeHandle()); | 1101 DownloadInProgressDialogView::Show(browser_.get(), GetNativeHandle()); |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 void BrowserView::ShowCreateWebAppShortcutsDialog( | 1104 void BrowserView::ShowCreateWebAppShortcutsDialog( |
| 1105 TabContentsWrapper* tab_contents) { | 1105 TabContentsWrapper* tab_contents) { |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 gfx::Point origin(-overlap, contents_height - height + overlap); | 1889 gfx::Point origin(-overlap, contents_height - height + overlap); |
| 1890 status_bubble_->SetBounds(origin.x(), origin.y(), width() / 3, height); | 1890 status_bubble_->SetBounds(origin.x(), origin.y(), width() / 3, height); |
| 1891 } | 1891 } |
| 1892 | 1892 |
| 1893 bool BrowserView::MaybeShowBookmarkBar(TabContentsWrapper* contents) { | 1893 bool BrowserView::MaybeShowBookmarkBar(TabContentsWrapper* contents) { |
| 1894 views::View* new_bookmark_bar_view = NULL; | 1894 views::View* new_bookmark_bar_view = NULL; |
| 1895 if (browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) && | 1895 if (browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) && |
| 1896 contents) { | 1896 contents) { |
| 1897 if (!bookmark_bar_view_.get()) { | 1897 if (!bookmark_bar_view_.get()) { |
| 1898 bookmark_bar_view_.reset(new BookmarkBarView(browser_.get())); | 1898 bookmark_bar_view_.reset(new BookmarkBarView(browser_.get())); |
| 1899 bookmark_bar_view_->set_parent_owned(false); | 1899 bookmark_bar_view_->set_owned_by_client(); |
| 1900 bookmark_bar_view_->set_background( | 1900 bookmark_bar_view_->set_background( |
| 1901 new BookmarkExtensionBackground(this, bookmark_bar_view_.get(), | 1901 new BookmarkExtensionBackground(this, bookmark_bar_view_.get(), |
| 1902 browser_.get())); | 1902 browser_.get())); |
| 1903 bookmark_bar_view_->SetBookmarkBarState( | 1903 bookmark_bar_view_->SetBookmarkBarState( |
| 1904 browser_->bookmark_bar_state(), | 1904 browser_->bookmark_bar_state(), |
| 1905 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); | 1905 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); |
| 1906 } | 1906 } |
| 1907 bookmark_bar_view_->SetPageNavigator(contents->web_contents()); | 1907 bookmark_bar_view_->SetPageNavigator(contents->web_contents()); |
| 1908 new_bookmark_bar_view = bookmark_bar_view_.get(); | 1908 new_bookmark_bar_view = bookmark_bar_view_.get(); |
| 1909 } | 1909 } |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 return; | 2404 return; |
| 2405 | 2405 |
| 2406 PasswordGenerationBubbleView* bubble = | 2406 PasswordGenerationBubbleView* bubble = |
| 2407 new PasswordGenerationBubbleView(bounds, | 2407 new PasswordGenerationBubbleView(bounds, |
| 2408 this, | 2408 this, |
| 2409 web_contents->GetRenderViewHost()); | 2409 web_contents->GetRenderViewHost()); |
| 2410 views::BubbleDelegateView::CreateBubble(bubble); | 2410 views::BubbleDelegateView::CreateBubble(bubble); |
| 2411 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2411 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2412 bubble->Show(); | 2412 bubble->Show(); |
| 2413 } | 2413 } |
| OLD | NEW |