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

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

Issue 2331093002: UMA stats for stylus usage (Closed)
Patch Set: nit and rebase Created 4 years, 2 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
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_non_client_frame_view_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/ash_layout_constants.h" 9 #include "ash/common/ash_layout_constants.h"
10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h "
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "ui/compositor/layer_animator.h" 49 #include "ui/compositor/layer_animator.h"
50 #include "ui/gfx/canvas.h" 50 #include "ui/gfx/canvas.h"
51 #include "ui/gfx/geometry/rect_conversions.h" 51 #include "ui/gfx/geometry/rect_conversions.h"
52 #include "ui/gfx/image/image_skia.h" 52 #include "ui/gfx/image/image_skia.h"
53 #include "ui/gfx/scoped_canvas.h" 53 #include "ui/gfx/scoped_canvas.h"
54 #include "ui/views/controls/label.h" 54 #include "ui/views/controls/label.h"
55 #include "ui/views/layout/layout_constants.h" 55 #include "ui/views/layout/layout_constants.h"
56 #include "ui/views/widget/widget.h" 56 #include "ui/views/widget/widget.h"
57 #include "ui/views/widget/widget_delegate.h" 57 #include "ui/views/widget/widget_delegate.h"
58 58
59 #if defined(OS_CHROMEOS)
60 #include "ash/shared/app_types.h"
61 #endif
62
59 namespace { 63 namespace {
60 64
61 // Space between right edge of tabstrip and maximize button. 65 // Space between right edge of tabstrip and maximize button.
62 const int kTabstripRightSpacing = 10; 66 const int kTabstripRightSpacing = 10;
63 // Height of the shadow of the content area, at the top of the toolbar. 67 // Height of the shadow of the content area, at the top of the toolbar.
64 const int kContentShadowHeight = 1; 68 const int kContentShadowHeight = 1;
65 // Space between top of window and top of tabstrip for tall headers, such as 69 // Space between top of window and top of tabstrip for tall headers, such as
66 // for restored windows, apps, etc. 70 // for restored windows, apps, etc.
67 const int kTabstripTopSpacingTall = 7; 71 const int kTabstripTopSpacingTall = 7;
68 // Space between top of window and top of tabstrip for short headers, such as 72 // Space between top of window and top of tabstrip for short headers, such as
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 header_painter->UpdateLeftHeaderView(web_app_left_header_view_); 134 header_painter->UpdateLeftHeaderView(web_app_left_header_view_);
131 } else if (window_icon_) { 135 } else if (window_icon_) {
132 header_painter->UpdateLeftHeaderView(window_icon_); 136 header_painter->UpdateLeftHeaderView(window_icon_);
133 } 137 }
134 } else { 138 } else {
135 BrowserHeaderPainterAsh* header_painter = new BrowserHeaderPainterAsh; 139 BrowserHeaderPainterAsh* header_painter = new BrowserHeaderPainterAsh;
136 header_painter_.reset(header_painter); 140 header_painter_.reset(header_painter);
137 header_painter->Init(frame(), browser_view(), this, window_icon_, 141 header_painter->Init(frame(), browser_view(), this, window_icon_,
138 caption_button_container_); 142 caption_button_container_);
139 } 143 }
144
145 #if defined(OS_CHROMEOS)
146 if (browser_view()->browser()->is_app()) {
147 frame()->GetNativeWindow()->SetProperty(
148 aura::client::kAppType, static_cast<int>(ash::AppType::CHROME_APP));
149 } else {
150 frame()->GetNativeWindow()->SetProperty(
151 aura::client::kAppType, static_cast<int>(ash::AppType::BROWSER));
152 }
153 #endif
140 } 154 }
141 155
142 /////////////////////////////////////////////////////////////////////////////// 156 ///////////////////////////////////////////////////////////////////////////////
143 // BrowserNonClientFrameView: 157 // BrowserNonClientFrameView:
144 158
145 gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForTabStrip( 159 gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForTabStrip(
146 views::View* tabstrip) const { 160 views::View* tabstrip) const {
147 if (!tabstrip) 161 if (!tabstrip)
148 return gfx::Rect(); 162 return gfx::Rect();
149 163
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 // TODO(pkasting): The "2 *" part of this makes no sense to me. 577 // TODO(pkasting): The "2 *" part of this makes no sense to me.
564 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, 578 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w,
565 img_y, img_w, img_h); 579 img_y, img_w, img_h);
566 580
567 // Toolbar/content separator. 581 // Toolbar/content separator.
568 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, 582 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness,
569 kClientEdgeThickness, 0); 583 kClientEdgeThickness, 0);
570 canvas->FillRect(toolbar_bounds, separator_color); 584 canvas->FillRect(toolbar_bounds, separator_color);
571 } 585 }
572 } 586 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698