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

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

Issue 14969012: components: Create web_modal component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 years, 7 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 | Annotate | Revision Log
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/frame/browser_frame.h" 17 #include "chrome/browser/ui/views/frame/browser_frame.h"
18 #include "chrome/browser/ui/views/frame/browser_view.h" 18 #include "chrome/browser/ui/views/frame/browser_view.h"
19 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" 19 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h"
20 #include "chrome/browser/ui/views/frame/contents_container.h" 20 #include "chrome/browser/ui/views/frame/contents_container.h"
21 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" 21 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
22 #include "chrome/browser/ui/views/frame/overlay_container.h" 22 #include "chrome/browser/ui/views/frame/overlay_container.h"
23 #include "chrome/browser/ui/views/frame/top_container_view.h" 23 #include "chrome/browser/ui/views/frame/top_container_view.h"
24 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" 24 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
25 #include "chrome/browser/ui/views/tabs/tab_strip.h" 25 #include "chrome/browser/ui/views/tabs/tab_strip.h"
26 #include "chrome/browser/ui/web_contents_modal_dialog_host.h" 26 #include "components/web_modal/web_contents_modal_dialog_host.h"
27 #include "ui/base/hit_test.h" 27 #include "ui/base/hit_test.h"
28 #include "ui/gfx/point.h" 28 #include "ui/gfx/point.h"
29 #include "ui/gfx/scrollbar_size.h" 29 #include "ui/gfx/scrollbar_size.h"
30 #include "ui/gfx/size.h" 30 #include "ui/gfx/size.h"
31 #include "ui/views/controls/webview/webview.h" 31 #include "ui/views/controls/webview/webview.h"
32 32
33 using views::View; 33 using views::View;
34 using web_modal::WebContentsModalDialogHost;
35 using web_modal::WebContentsModalDialogHostObserver;
34 36
35 namespace { 37 namespace {
36 38
37 // The visible height of the shadow above the tabs. Clicks in this area are 39 // The visible height of the shadow above the tabs. Clicks in this area are
38 // treated as clicks to the frame, rather than clicks to the tab. 40 // treated as clicks to the frame, rather than clicks to the tab.
39 const int kTabShadowSize = 2; 41 const int kTabShadowSize = 2;
40 // The number of pixels the bookmark bar should overlap the spacer by if the 42 // The number of pixels the bookmark bar should overlap the spacer by if the
41 // spacer is visible. 43 // spacer is visible.
42 const int kSpacerBookmarkBarOverlap = 1; 44 const int kSpacerBookmarkBarOverlap = 1;
43 // The number of pixels the metro switcher is offset from the right edge. 45 // The number of pixels the metro switcher is offset from the right edge.
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 return bottom; 610 return bottom;
609 } 611 }
610 612
611 bool BrowserViewLayout::InfobarVisible() const { 613 bool BrowserViewLayout::InfobarVisible() const {
612 // Cast to a views::View to access GetPreferredSize(). 614 // Cast to a views::View to access GetPreferredSize().
613 views::View* infobar_container = infobar_container_; 615 views::View* infobar_container = infobar_container_;
614 // NOTE: Can't check if the size IsEmpty() since it's always 0-width. 616 // NOTE: Can't check if the size IsEmpty() since it's always 0-width.
615 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) && 617 return browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR) &&
616 (infobar_container->GetPreferredSize().height() != 0); 618 (infobar_container->GetPreferredSize().height() != 0);
617 } 619 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_layout.h ('k') | chrome/browser/ui/views/login_prompt_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698