| 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 #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" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/browser/ui/search/search_model.h" | 52 #include "chrome/browser/ui/search/search_model.h" |
| 53 #include "chrome/browser/ui/search/search_ui.h" | 53 #include "chrome/browser/ui/search/search_ui.h" |
| 54 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 54 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 55 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 55 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 56 #include "chrome/browser/ui/view_ids.h" | 56 #include "chrome/browser/ui/view_ids.h" |
| 57 #include "chrome/browser/ui/views/accelerator_table.h" | 57 #include "chrome/browser/ui/views/accelerator_table.h" |
| 58 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" | 58 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" |
| 59 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" | 59 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
| 60 #include "chrome/browser/ui/views/avatar_menu_button.h" | 60 #include "chrome/browser/ui/views/avatar_menu_button.h" |
| 61 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 61 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
| 62 #include "chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.h" |
| 62 #include "chrome/browser/ui/views/browser_dialogs.h" | 63 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 63 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" | 64 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
| 64 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 65 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
| 65 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 66 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 66 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" | 67 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" |
| 67 #include "chrome/browser/ui/views/frame/contents_container.h" | 68 #include "chrome/browser/ui/views/frame/contents_container.h" |
| 68 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 69 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 69 #include "chrome/browser/ui/views/frame/instant_overlay_controller_views.h" | 70 #include "chrome/browser/ui/views/frame/instant_overlay_controller_views.h" |
| 70 #include "chrome/browser/ui/views/frame/overlay_container.h" | 71 #include "chrome/browser/ui/views/frame/overlay_container.h" |
| 71 #include "chrome/browser/ui/views/frame/top_container_view.h" | 72 #include "chrome/browser/ui/views/frame/top_container_view.h" |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 | 1109 |
| 1109 void BrowserView::ToggleBookmarkBar() { | 1110 void BrowserView::ToggleBookmarkBar() { |
| 1110 chrome::ToggleBookmarkBarWhenVisible(browser_->profile()); | 1111 chrome::ToggleBookmarkBarWhenVisible(browser_->profile()); |
| 1111 } | 1112 } |
| 1112 | 1113 |
| 1113 void BrowserView::ShowUpdateChromeDialog() { | 1114 void BrowserView::ShowUpdateChromeDialog() { |
| 1114 UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow()); | 1115 UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow()); |
| 1115 } | 1116 } |
| 1116 | 1117 |
| 1117 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { | 1118 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { |
| 1119 views::View* sync_promo = NULL; |
| 1120 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1121 if (command_line->HasSwitch(switches::kEnableBookmarkSyncPromo) && |
| 1122 SyncPromoUI::ShouldShowSyncPromo(browser()->profile())) { |
| 1123 sync_promo = new BookmarkSyncPromoView(browser_.get()); |
| 1124 } |
| 1125 |
| 1118 chrome::ShowBookmarkBubbleView(GetToolbarView()->GetBookmarkBubbleAnchor(), | 1126 chrome::ShowBookmarkBubbleView(GetToolbarView()->GetBookmarkBubbleAnchor(), |
| 1119 bookmark_bar_view_.get(), browser_->profile(), | 1127 bookmark_bar_view_.get(), |
| 1120 url, !already_bookmarked); | 1128 browser_->profile(), |
| 1129 url, |
| 1130 !already_bookmarked, |
| 1131 sync_promo); |
| 1121 } | 1132 } |
| 1122 | 1133 |
| 1123 void BrowserView::ShowBookmarkPrompt() { | 1134 void BrowserView::ShowBookmarkPrompt() { |
| 1124 GetLocationBarView()->ShowBookmarkPrompt(); | 1135 GetLocationBarView()->ShowBookmarkPrompt(); |
| 1125 } | 1136 } |
| 1126 | 1137 |
| 1127 void BrowserView::ShowChromeToMobileBubble() { | 1138 void BrowserView::ShowChromeToMobileBubble() { |
| 1128 GetLocationBarView()->ShowChromeToMobileBubble(); | 1139 GetLocationBarView()->ShowChromeToMobileBubble(); |
| 1129 } | 1140 } |
| 1130 | 1141 |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2741 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2752 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
| 2742 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2753 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
| 2743 LocationBarView::kIconInternalPadding + 1); | 2754 LocationBarView::kIconInternalPadding + 1); |
| 2744 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2755 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
| 2745 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2756 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2746 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2757 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2747 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2758 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2748 } | 2759 } |
| 2749 return top_arrow_height; | 2760 return top_arrow_height; |
| 2750 } | 2761 } |
| OLD | NEW |