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" | |
18 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 17 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
19 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" | 18 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" |
20 #include "chrome/browser/bookmarks/bookmark_utils.h" | 19 #include "chrome/browser/bookmarks/bookmark_utils.h" |
21 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/debugger/devtools_window.h" | 21 #include "chrome/browser/debugger/devtools_window.h" |
23 #include "chrome/browser/extensions/extension_tab_helper.h" | 22 #include "chrome/browser/extensions/extension_tab_helper.h" |
24 #include "chrome/browser/instant/instant_controller.h" | 23 #include "chrome/browser/instant/instant_controller.h" |
25 #include "chrome/browser/managed_mode.h" | 24 #include "chrome/browser/managed_mode.h" |
26 #include "chrome/browser/native_window_notification_source.h" | 25 #include "chrome/browser/native_window_notification_source.h" |
27 #include "chrome/browser/ntp_background_util.h" | 26 #include "chrome/browser/ntp_background_util.h" |
28 #include "chrome/browser/prefs/pref_service.h" | 27 #include "chrome/browser/prefs/pref_service.h" |
29 #include "chrome/browser/profiles/avatar_menu_model.h" | 28 #include "chrome/browser/profiles/avatar_menu_model.h" |
30 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
31 #include "chrome/browser/profiles/profile_info_cache.h" | 30 #include "chrome/browser/profiles/profile_info_cache.h" |
32 #include "chrome/browser/profiles/profile_manager.h" | 31 #include "chrome/browser/profiles/profile_manager.h" |
33 #include "chrome/browser/sessions/tab_restore_service.h" | 32 #include "chrome/browser/sessions/tab_restore_service.h" |
34 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 33 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
35 #include "chrome/browser/speech/extension_api/tts_extension_api.h" | 34 #include "chrome/browser/speech/extension_api/tts_extension_api.h" |
36 #include "chrome/browser/themes/theme_service.h" | 35 #include "chrome/browser/themes/theme_service.h" |
37 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 36 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
38 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
39 #include "chrome/browser/ui/browser_dialogs.h" | 38 #include "chrome/browser/ui/browser_dialogs.h" |
40 #include "chrome/browser/ui/browser_list.h" | 39 #include "chrome/browser/ui/browser_list.h" |
41 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 40 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
42 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 41 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
43 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 42 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
44 #include "chrome/browser/ui/view_ids.h" | 43 #include "chrome/browser/ui/view_ids.h" |
| 44 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" |
45 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" | 45 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
46 #include "chrome/browser/ui/views/avatar_menu_button.h" | 46 #include "chrome/browser/ui/views/avatar_menu_button.h" |
47 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 47 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
48 #include "chrome/browser/ui/views/browser_dialogs.h" | 48 #include "chrome/browser/ui/views/browser_dialogs.h" |
49 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 49 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
50 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 50 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
51 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 51 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
52 #include "chrome/browser/ui/views/frame/contents_container.h" | 52 #include "chrome/browser/ui/views/frame/contents_container.h" |
53 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" | 53 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" |
54 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 54 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // If we do find there are cases where we need to restore the focus on show, | 553 // If we do find there are cases where we need to restore the focus on show, |
554 // that should be added and this should be removed. | 554 // that should be added and this should be removed. |
555 RestoreFocus(); | 555 RestoreFocus(); |
556 | 556 |
557 frame_->Show(); | 557 frame_->Show(); |
558 | 558 |
559 force_location_bar_focus_ = false; | 559 force_location_bar_focus_ = false; |
560 | 560 |
561 browser()->OnWindowDidShow(); | 561 browser()->OnWindowDidShow(); |
562 | 562 |
563 InvertBubble::MaybeShowInvertBubble(browser_->profile(), contents_); | 563 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_); |
564 } | 564 } |
565 | 565 |
566 void BrowserView::ShowInactive() { | 566 void BrowserView::ShowInactive() { |
567 if (frame_->IsVisible()) | 567 if (frame_->IsVisible()) |
568 return; | 568 return; |
569 CreateLauncherIcon(); | 569 CreateLauncherIcon(); |
570 frame_->ShowInactive(); | 570 frame_->ShowInactive(); |
571 } | 571 } |
572 | 572 |
573 void BrowserView::SetBounds(const gfx::Rect& bounds) { | 573 void BrowserView::SetBounds(const gfx::Rect& bounds) { |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 | 1758 |
1759 bool BrowserView::SplitHandleMoved(views::SingleSplitView* sender) { | 1759 bool BrowserView::SplitHandleMoved(views::SingleSplitView* sender) { |
1760 for (int i = 0; i < sender->child_count(); ++i) | 1760 for (int i = 0; i < sender->child_count(); ++i) |
1761 sender->child_at(i)->InvalidateLayout(); | 1761 sender->child_at(i)->InvalidateLayout(); |
1762 SchedulePaint(); | 1762 SchedulePaint(); |
1763 Layout(); | 1763 Layout(); |
1764 return false; | 1764 return false; |
1765 } | 1765 } |
1766 | 1766 |
1767 void BrowserView::OnSysColorChange() { | 1767 void BrowserView::OnSysColorChange() { |
1768 InvertBubble::MaybeShowInvertBubble(browser_->profile(), contents_); | 1768 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_); |
1769 } | 1769 } |
1770 | 1770 |
1771 views::LayoutManager* BrowserView::CreateLayoutManager() const { | 1771 views::LayoutManager* BrowserView::CreateLayoutManager() const { |
1772 return new BrowserViewLayout; | 1772 return new BrowserViewLayout; |
1773 } | 1773 } |
1774 | 1774 |
1775 ToolbarView* BrowserView::CreateToolbar() const { | 1775 ToolbarView* BrowserView::CreateToolbar() const { |
1776 return new ToolbarView(browser_.get()); | 1776 return new ToolbarView(browser_.get()); |
1777 } | 1777 } |
1778 | 1778 |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 return; | 2409 return; |
2410 | 2410 |
2411 PasswordGenerationBubbleView* bubble = | 2411 PasswordGenerationBubbleView* bubble = |
2412 new PasswordGenerationBubbleView(bounds, | 2412 new PasswordGenerationBubbleView(bounds, |
2413 this, | 2413 this, |
2414 web_contents->GetRenderViewHost()); | 2414 web_contents->GetRenderViewHost()); |
2415 views::BubbleDelegateView::CreateBubble(bubble); | 2415 views::BubbleDelegateView::CreateBubble(bubble); |
2416 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2416 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2417 bubble->Show(); | 2417 bubble->Show(); |
2418 } | 2418 } |
OLD | NEW |