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

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

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 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 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/chromeos/frame/browser_view.h" 5 #include "chrome/browser/chromeos/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (browser_view_->IsFullscreen() || !browser_view_->IsTabStripVisible()) { 82 if (browser_view_->IsFullscreen() || !browser_view_->IsTabStripVisible()) {
83 status_area_->SetVisible(false); 83 status_area_->SetVisible(false);
84 tabstrip_->SetVisible(false); 84 tabstrip_->SetVisible(false);
85 tabstrip_->SetBounds(0, 0, 0, 0); 85 tabstrip_->SetBounds(0, 0, 0, 0);
86 return 0; 86 return 0;
87 } 87 }
88 88
89 gfx::Rect tabstrip_bounds( 89 gfx::Rect tabstrip_bounds(
90 browser_view_->frame()->GetBoundsForTabStrip(tabstrip_)); 90 browser_view_->frame()->GetBoundsForTabStrip(tabstrip_));
91 gfx::Point tabstrip_origin = tabstrip_bounds.origin(); 91 gfx::Point tabstrip_origin = tabstrip_bounds.origin();
92 views::View::ConvertPointToView(browser_view_->GetParent(), browser_view_, 92 views::View::ConvertPointToView(browser_view_->parent(), browser_view_,
93 &tabstrip_origin); 93 &tabstrip_origin);
94 tabstrip_bounds.set_origin(tabstrip_origin); 94 tabstrip_bounds.set_origin(tabstrip_origin);
95 return browser_view_->UseVerticalTabs() ? 95 return browser_view_->UseVerticalTabs() ?
96 LayoutTitlebarComponentsWithVerticalTabs(tabstrip_bounds) : 96 LayoutTitlebarComponentsWithVerticalTabs(tabstrip_bounds) :
97 LayoutTitlebarComponents(tabstrip_bounds); 97 LayoutTitlebarComponents(tabstrip_bounds);
98 } 98 }
99 99
100 virtual int LayoutToolbar(int top) { 100 virtual int LayoutToolbar(int top) {
101 if (!browser_view_->IsFullscreen() && browser_view_->IsTabStripVisible() && 101 if (!browser_view_->IsFullscreen() && browser_view_->IsTabStripVisible() &&
102 browser_view_->UseVerticalTabs()) { 102 browser_view_->UseVerticalTabs()) {
103 // For vertical tabs the toolbar is positioned in 103 // For vertical tabs the toolbar is positioned in
104 // LayoutTitlebarComponentsWithVerticalTabs. 104 // LayoutTitlebarComponentsWithVerticalTabs.
105 return top; 105 return top;
106 } 106 }
107 return ::BrowserViewLayout::LayoutToolbar(top); 107 return ::BrowserViewLayout::LayoutToolbar(top);
108 } 108 }
109 109
110 virtual bool IsPositionInWindowCaption(const gfx::Point& point) { 110 virtual bool IsPositionInWindowCaption(const gfx::Point& point) {
111 return ::BrowserViewLayout::IsPositionInWindowCaption(point) 111 return ::BrowserViewLayout::IsPositionInWindowCaption(point)
112 && !IsPointInViewsInTitleArea(point); 112 && !IsPointInViewsInTitleArea(point);
113 } 113 }
114 114
115 virtual int NonClientHitTest(const gfx::Point& point) { 115 virtual int NonClientHitTest(const gfx::Point& point) {
116 gfx::Point point_in_browser_view_coords(point); 116 gfx::Point point_in_browser_view_coords(point);
117 views::View::ConvertPointToView( 117 views::View::ConvertPointToView(
118 browser_view_->GetParent(), browser_view_, 118 browser_view_->parent(), browser_view_,
119 &point_in_browser_view_coords); 119 &point_in_browser_view_coords);
120 return IsPointInViewsInTitleArea(point_in_browser_view_coords) ? 120 return IsPointInViewsInTitleArea(point_in_browser_view_coords) ?
121 HTCLIENT : ::BrowserViewLayout::NonClientHitTest(point); 121 HTCLIENT : ::BrowserViewLayout::NonClientHitTest(point);
122 } 122 }
123 123
124 private: 124 private:
125 chromeos::BrowserView* chromeos_browser_view() { 125 chromeos::BrowserView* chromeos_browser_view() {
126 return static_cast<chromeos::BrowserView*>(browser_view_); 126 return static_cast<chromeos::BrowserView*>(browser_view_);
127 } 127 }
128 128
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 // views::ContextMenuController overrides. 307 // views::ContextMenuController overrides.
308 void BrowserView::ShowContextMenu(views::View* source, 308 void BrowserView::ShowContextMenu(views::View* source,
309 const gfx::Point& p, 309 const gfx::Point& p,
310 bool is_mouse_gesture) { 310 bool is_mouse_gesture) {
311 // Only show context menu if point is in unobscured parts of browser, i.e. 311 // Only show context menu if point is in unobscured parts of browser, i.e.
312 // if NonClientHitTest returns : 312 // if NonClientHitTest returns :
313 // - HTCAPTION: in title bar or unobscured part of tabstrip 313 // - HTCAPTION: in title bar or unobscured part of tabstrip
314 // - HTNOWHERE: as the name implies. 314 // - HTNOWHERE: as the name implies.
315 gfx::Point point_in_parent_coords(p); 315 gfx::Point point_in_parent_coords(p);
316 views::View::ConvertPointToView(NULL, GetParent(), &point_in_parent_coords); 316 views::View::ConvertPointToView(NULL, parent(), &point_in_parent_coords);
317 int hit_test = NonClientHitTest(point_in_parent_coords); 317 int hit_test = NonClientHitTest(point_in_parent_coords);
318 if (hit_test == HTCAPTION || hit_test == HTNOWHERE) 318 if (hit_test == HTCAPTION || hit_test == HTNOWHERE)
319 system_menu_menu_->RunMenuAt(p, views::Menu2::ALIGN_TOPLEFT); 319 system_menu_menu_->RunMenuAt(p, views::Menu2::ALIGN_TOPLEFT);
320 } 320 }
321 321
322 void BrowserView::OnMenuOpened() { 322 void BrowserView::OnMenuOpened() {
323 // Save the focused widget before wrench menu opens. 323 // Save the focused widget before wrench menu opens.
324 saved_focused_widget_ = gtk_window_get_focus(GetNativeHandle()); 324 saved_focused_widget_ = gtk_window_get_focus(GetNativeHandle());
325 } 325 }
326 326
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 385 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
386 // Create a browser view for chromeos. 386 // Create a browser view for chromeos.
387 BrowserView* view; 387 BrowserView* view;
388 if (browser->type() & Browser::TYPE_POPUP) 388 if (browser->type() & Browser::TYPE_POPUP)
389 view = new chromeos::PanelBrowserView(browser); 389 view = new chromeos::PanelBrowserView(browser);
390 else 390 else
391 view = new chromeos::BrowserView(browser); 391 view = new chromeos::BrowserView(browser);
392 BrowserFrame::Create(view, browser->profile()); 392 BrowserFrame::Create(view, browser->profile());
393 return view; 393 return view;
394 } 394 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698