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" |
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 } | 2154 } |
2155 devtools_container_->SetVisible(true); | 2155 devtools_container_->SetVisible(true); |
2156 devtools_dock_side_ = devtools_window_->dock_side(); | 2156 devtools_dock_side_ = devtools_window_->dock_side(); |
2157 bool dock_to_right = devtools_dock_side_ == DEVTOOLS_DOCK_SIDE_RIGHT; | 2157 bool dock_to_right = devtools_dock_side_ == DEVTOOLS_DOCK_SIDE_RIGHT; |
2158 contents_split_->set_orientation( | 2158 contents_split_->set_orientation( |
2159 dock_to_right ? views::SingleSplitView::HORIZONTAL_SPLIT | 2159 dock_to_right ? views::SingleSplitView::HORIZONTAL_SPLIT |
2160 : views::SingleSplitView::VERTICAL_SPLIT); | 2160 : views::SingleSplitView::VERTICAL_SPLIT); |
2161 UpdateDevToolsSplitPosition(); | 2161 UpdateDevToolsSplitPosition(); |
2162 contents_split_->InvalidateLayout(); | 2162 contents_split_->InvalidateLayout(); |
2163 Layout(); | 2163 Layout(); |
2164 // In NTP search mode, schedule a repaint of toolbar and tabstrip. | |
2165 if (browser()->search_model()->mode().is_ntp()) { | |
2166 toolbar_->SchedulePaint(); | |
2167 tabstrip_->SchedulePaint(); | |
2168 } | |
2169 } | 2164 } |
2170 | 2165 |
2171 void BrowserView::HideDevToolsContainer() { | 2166 void BrowserView::HideDevToolsContainer() { |
2172 // Restore focus to the last focused view when hiding devtools window. | 2167 // Restore focus to the last focused view when hiding devtools window. |
2173 devtools_focus_tracker_->FocusLastFocusedExternalView(); | 2168 devtools_focus_tracker_->FocusLastFocusedExternalView(); |
2174 devtools_container_->SetVisible(false); | 2169 devtools_container_->SetVisible(false); |
2175 contents_split_->InvalidateLayout(); | 2170 contents_split_->InvalidateLayout(); |
2176 Layout(); | 2171 Layout(); |
2177 // In NTP search mode, schedule a repaint of toolbar and tabstrip. | |
2178 if (browser()->search_model()->mode().is_ntp()) { | |
2179 toolbar_->SchedulePaint(); | |
2180 tabstrip_->SchedulePaint(); | |
2181 } | |
2182 } | 2172 } |
2183 | 2173 |
2184 void BrowserView::UpdateDevToolsSplitPosition() { | 2174 void BrowserView::UpdateDevToolsSplitPosition() { |
2185 if (devtools_window_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT) { | 2175 if (devtools_window_->dock_side() == DEVTOOLS_DOCK_SIDE_RIGHT) { |
2186 int split_offset = contents_split_->width() - | 2176 int split_offset = contents_split_->width() - |
2187 devtools_window_->GetWidth(contents_split_->width()); | 2177 devtools_window_->GetWidth(contents_split_->width()); |
2188 contents_split_->set_divider_offset(split_offset); | 2178 contents_split_->set_divider_offset(split_offset); |
2189 } else { | 2179 } else { |
2190 int split_offset = contents_split_->height() - | 2180 int split_offset = contents_split_->height() - |
2191 devtools_window_->GetHeight(contents_split_->height()); | 2181 devtools_window_->GetHeight(contents_split_->height()); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2596 modal_browser->window()->Activate(); | 2586 modal_browser->window()->Activate(); |
2597 } | 2587 } |
2598 | 2588 |
2599 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2589 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
2600 } | 2590 } |
2601 | 2591 |
2602 void BrowserView::MaybeStackBookmarkBarAtTop() { | 2592 void BrowserView::MaybeStackBookmarkBarAtTop() { |
2603 if (bookmark_bar_view_.get()) | 2593 if (bookmark_bar_view_.get()) |
2604 bookmark_bar_view_->MaybeStackAtTop(); | 2594 bookmark_bar_view_->MaybeStackAtTop(); |
2605 } | 2595 } |
OLD | NEW |