Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_layout.cc

Issue 1270783005: V1 of material design find in page bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: suffixual f Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.cc ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_layout.h" 5 #include "chrome/browser/ui/views/frame/browser_view_layout.h"
6 6
7 #include "base/observer_list.h" 7 #include "base/observer_list.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
11 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/find_bar/find_bar.h" 12 #include "chrome/browser/ui/find_bar/find_bar.h"
13 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 13 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
14 #include "chrome/browser/ui/search/search_model.h" 14 #include "chrome/browser/ui/search/search_model.h"
15 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 15 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
16 #include "chrome/browser/ui/views/download/download_shelf_view.h" 16 #include "chrome/browser/ui/views/download/download_shelf_view.h"
17 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" 17 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
18 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" 18 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h"
19 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" 19 #include "chrome/browser/ui/views/frame/contents_layout_manager.h"
20 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" 20 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
21 #include "chrome/browser/ui/views/frame/top_container_view.h" 21 #include "chrome/browser/ui/views/frame/top_container_view.h"
22 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" 22 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
23 #include "chrome/browser/ui/views/tabs/tab_strip.h" 23 #include "chrome/browser/ui/views/tabs/tab_strip.h"
24 #include "components/web_modal/web_contents_modal_dialog_host.h" 24 #include "components/web_modal/web_contents_modal_dialog_host.h"
25 #include "ui/base/hit_test.h" 25 #include "ui/base/hit_test.h"
26 #include "ui/base/resource/material_design/material_design_controller.h"
26 #include "ui/gfx/geometry/point.h" 27 #include "ui/gfx/geometry/point.h"
27 #include "ui/gfx/geometry/size.h" 28 #include "ui/gfx/geometry/size.h"
28 #include "ui/gfx/scrollbar_size.h" 29 #include "ui/gfx/scrollbar_size.h"
29 #include "ui/views/controls/webview/webview.h" 30 #include "ui/views/controls/webview/webview.h"
30 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
31 #include "ui/views/window/client_view.h" 32 #include "ui/views/window/client_view.h"
32 33
33 using views::View; 34 using views::View;
34 using web_modal::WebContentsModalDialogHost; 35 using web_modal::WebContentsModalDialogHost;
35 using web_modal::ModalDialogHostObserver; 36 using web_modal::ModalDialogHostObserver;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 top_container_->GetLocalBounds()); 218 top_container_->GetLocalBounds());
218 219
219 int find_bar_y = 0; 220 int find_bar_y = 0;
220 if (immersive_mode_controller_->IsEnabled() && 221 if (immersive_mode_controller_->IsEnabled() &&
221 !immersive_mode_controller_->IsRevealed()) { 222 !immersive_mode_controller_->IsRevealed()) {
222 // Position the find bar exactly below the top container. In immersive 223 // Position the find bar exactly below the top container. In immersive
223 // fullscreen, when the top-of-window views are not revealed, only the 224 // fullscreen, when the top-of-window views are not revealed, only the
224 // miniature immersive style tab strip is visible. Do not overlap the 225 // miniature immersive style tab strip is visible. Do not overlap the
225 // find bar and the tab strip. 226 // find bar and the tab strip.
226 find_bar_y = top_container_bounds.bottom(); 227 find_bar_y = top_container_bounds.bottom();
228 } else if (ui::MaterialDesignController::IsModeMaterial()) {
229 find_bar_y = top_container_bounds.bottom() - 6;
227 } else { 230 } else {
228 // Position the find bar 1 pixel above the bottom of the top container 231 // Position the find bar 1 pixel above the bottom of the top container
229 // so that it occludes the border between the content area and the top 232 // so that it occludes the border between the content area and the top
230 // container and looks connected to the top container. 233 // container and looks connected to the top container.
231 find_bar_y = top_container_bounds.bottom() - 1; 234 find_bar_y = top_container_bounds.bottom() - 1;
232 } 235 }
233 236
234 // Grow the height of |bounding_box| by the height of any elements between 237 // Grow the height of |bounding_box| by the height of any elements between
235 // the top container and |contents_container_| such as the detached bookmark 238 // the top container and |contents_container_| such as the detached bookmark
236 // bar and any infobars. 239 // bar and any infobars.
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 return bottom; 543 return bottom;
541 } 544 }
542 545
543 bool BrowserViewLayout::InfobarVisible() const { 546 bool BrowserViewLayout::InfobarVisible() const {
544 // Cast to a views::View to access GetPreferredSize(). 547 // Cast to a views::View to access GetPreferredSize().
545 views::View* infobar_container = infobar_container_; 548 views::View* infobar_container = infobar_container_;
546 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. 549 // NOTE: Can't check if the size IsEmpty() since it's always 0-width.
547 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && 550 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) &&
548 (infobar_container->GetPreferredSize().height() != 0); 551 (infobar_container->GetPreferredSize().height() != 0);
549 } 552 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.cc ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698