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

Side by Side Diff: chrome/browser/chromeos/frame/browser_frame_view_chromeos.cc

Issue 6904160: Implement new gray mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed power test Created 9 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
(Empty)
1 // Copyright (c) 2011 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/frame/browser_frame_view_chromeos.h"
6
7 #include "chrome/browser/ui/views/frame/browser_view.h"
8 #include "grit/generated_resources.h"
9 #include "grit/theme_resources.h"
10 #include "grit/theme_resources_standard.h"
11 #include "views/window/hit_test.h"
12 #include "views/window/window.h"
13 #include "ui/base/theme_provider.h"
14
15 namespace {
16 // Additional pixels of pad above the tabs.
17 const int kTopPad = 4;
18 // To align theme bitmaps correctly we return this offset.
19 const int kThemeOffset = -5;
20 }
21
22 namespace chromeos {
23
24 // BrowserFrameViewChromeos adds some a few pixels of pad to the top of the
sky 2011/05/02 14:26:27 remove some
25 // tabstrip. To enable this we have to grab mouse events in that area and
26 // forward them on to the NonClientView. We do this by overriding HitTest(),
27 // NonClientHitTest() and GetEventHandlerForPoint().
28 BrowserFrameViewChromeos::BrowserFrameViewChromeos(
29 BrowserFrame* frame, BrowserView* browser_view)
30 : OpaqueBrowserFrameView(frame, browser_view) {
31 }
32
33 BrowserFrameViewChromeos::~BrowserFrameViewChromeos() {
34 }
35
36 int BrowserFrameViewChromeos::GetHorizontalTabStripVerticalOffset(
sky 2011/05/02 14:26:27 order doesn't match header.
37 bool restored) const {
38 return NonClientTopBorderHeight(restored, true) + kTopPad;
39 }
40
41 int BrowserFrameViewChromeos::NonClientHitTest(const gfx::Point& point) {
42 if (point.y() < kTopPad)
43 return HTNOWHERE;
44 return OpaqueBrowserFrameView::NonClientHitTest(point);
45 }
46
47 bool BrowserFrameViewChromeos::HitTest(const gfx::Point& l) const {
48 if (l.y() < kTopPad)
49 return true;
50 return OpaqueBrowserFrameView::HitTest(l);
51 }
52
53 views::View* BrowserFrameViewChromeos::GetEventHandlerForPoint(const gfx::Point& point) {
sky 2011/05/02 14:26:27 > 80
54 if (point.y() < kTopPad) {
55 gfx::Point nc_point(point.x(), kTopPad);
56 views::NonClientView* nc_view = frame()->GetWindow()->non_client_view();
57 View::ConvertPointToView(this, nc_view, &nc_point);
58 return nc_view->GetEventHandlerForPoint(nc_point);
59 }
60 return OpaqueBrowserFrameView::GetEventHandlerForPoint(point);
61 }
62
63 void BrowserFrameViewChromeos::ModifyMaximizedFramePainting(
64 int* top_offset, SkBitmap** left_corner, SkBitmap** right_corner) {
65 *top_offset = kThemeOffset;
66 ui::ThemeProvider* tp = GetThemeProvider();
67 if (tp->HasCustomImage(IDR_THEME_FRAME))
68 return;
69 if (browser_view()->IsOffTheRecord()) {
70 *left_corner = tp->GetBitmapNamed(IDR_THEME_FRAME_INCOGNITO_LEFT);
71 *right_corner = tp->GetBitmapNamed(IDR_THEME_FRAME_INCOGNITO_RIGHT);
72 } else {
73 *left_corner = tp->GetBitmapNamed(IDR_THEME_FRAME_LEFT);
74 *right_corner = tp->GetBitmapNamed(IDR_THEME_FRAME_RIGHT);
75 }
76 }
77
78 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698