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

Side by Side Diff: chrome/browser/chromeos/webui/login/frame/dom_browser_frame_view.cc

Issue 6577003: Entire DOMBrowser stack (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 10 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
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/webui/login/frame/dom_browser_frame_view.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/renderer_host/render_view_host.h"
9 #include "chrome/browser/tab_contents/navigation_controller.h"
10 #include "chrome/browser/tab_contents/tab_contents.h"
11 #include "chrome/browser/tabs/tab_strip_model.h"
12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
14 #include "chrome/browser/ui/touch/frame/keyboard_container_view.h"
15 #include "chrome/browser/ui/views/frame/browser_view.h"
16 #include "chrome/browser/chromeos/frame/browser_view.h"
17 #include "chrome/common/notification_service.h"
18 #include "chrome/common/notification_type.h"
19 #include "views/window/window.h"
20
21 namespace chromeos {
22
23 ///////////////////////////////////////////////////////////////////////////////
24 // DOMBrowserFrameView, public:
25
26 DOMBrowserFrameView::DOMBrowserFrameView(::BrowserFrame* frame,
27 ::BrowserView* browser_view)
28 : TouchBrowserFrameView(frame, browser_view) {
29 }
30
31 DOMBrowserFrameView::~DOMBrowserFrameView() {
32 }
33
34 // static
35 BrowserNonClientFrameView* DOMBrowserFrameView::CreateBrowserNonClientFrameView(
36 ::BrowserFrame* frame,
37 ::BrowserView* browser_view) {
38 return new DOMBrowserFrameView(frame, browser_view);
39 }
40
41 ///////////////////////////////////////////////////////////////////////////////
42 // DOMBrowserFrameView, protected:
43
44 gfx::Rect DOMBrowserFrameView::GetBoundsForTabStrip(
45 views::View* tabstrip) const {
46 return gfx::Rect(0, 0, 0, 0);
47 }
48
49 void DOMBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
50 PaintMaximizedFrameBorder(canvas);
51 PaintTitleBar(canvas);
52 }
53
54 bool DOMBrowserFrameView::HitTest(const gfx::Point& l) const {
55 // If the point is outside the bounds of the client area, claim it.
56 bool in_nonclient = NonClientFrameView::HitTest(l);
57 if (in_nonclient)
58 return in_nonclient;
59
60 // Otherwise claim it only if it's in a non-tab portion of the tabstrip.
61 bool vertical_tabs = browser_view_->UseVerticalTabs();
62 gfx::Rect tabstrip_bounds = gfx::Rect(0, 0, 0, 0);
63 gfx::Point tabstrip_origin(tabstrip_bounds.origin());
64 View::ConvertPointToView(frame_->GetWindow()->GetClientView(),
65 this, &tabstrip_origin);
66 tabstrip_bounds.set_origin(tabstrip_origin);
67 if ((!vertical_tabs && l.y() > tabstrip_bounds.bottom()) ||
68 (vertical_tabs && l.x() > tabstrip_bounds.right())) {
69 return false;
70 }
71
72 // We convert from our parent's coordinates since we assume we fill its bounds
73 // completely. We need to do this since we're not a parent of the tabstrip,
74 // meaning ConvertPointToView would otherwise return something bogus.
75 gfx::Point browser_view_point(l);
76 View::ConvertPointToView(parent(), browser_view_, &browser_view_point);
77 return browser_view_->IsPositionInWindowCaption(browser_view_point);
78 }
79
80 void DOMBrowserFrameView::LayoutOTRAvatar() { }
81 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698