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

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

Issue 5184009: Revert 66784 - Converts usage of SetProp/GetProp to a map. Even after making ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 (c) 2010 The Chromium Authors. All rights reserved. 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 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/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "grit/webkit_resources.h" 75 #include "grit/webkit_resources.h"
76 #include "views/controls/single_split_view.h" 76 #include "views/controls/single_split_view.h"
77 #include "views/focus/external_focus_tracker.h" 77 #include "views/focus/external_focus_tracker.h"
78 #include "views/focus/view_storage.h" 78 #include "views/focus/view_storage.h"
79 #include "views/grid_layout.h" 79 #include "views/grid_layout.h"
80 #include "views/widget/root_view.h" 80 #include "views/widget/root_view.h"
81 #include "views/window/dialog_delegate.h" 81 #include "views/window/dialog_delegate.h"
82 #include "views/window/window.h" 82 #include "views/window/window.h"
83 83
84 #if defined(OS_WIN) 84 #if defined(OS_WIN)
85 #include "app/view_prop.h"
86 #include "app/win_util.h" 85 #include "app/win_util.h"
87 #include "chrome/browser/aeropeek_manager.h" 86 #include "chrome/browser/aeropeek_manager.h"
88 #include "chrome/browser/jumplist_win.h" 87 #include "chrome/browser/jumplist_win.h"
89 #elif defined(OS_LINUX) 88 #elif defined(OS_LINUX)
90 #include "chrome/browser/views/accelerator_table_gtk.h" 89 #include "chrome/browser/views/accelerator_table_gtk.h"
91 #include "views/window/hit_test.h" 90 #include "views/window/hit_test.h"
92 #include "views/window/window_gtk.h" 91 #include "views/window/window_gtk.h"
93 #endif 92 #endif
94 93
95 using base::TimeDelta; 94 using base::TimeDelta;
96 using views::ColumnSet; 95 using views::ColumnSet;
97 using views::GridLayout; 96 using views::GridLayout;
98 97
99 // The height of the status bubble. 98 // The height of the status bubble.
100 static const int kStatusBubbleHeight = 20; 99 static const int kStatusBubbleHeight = 20;
101 // The name of a key to store on the window handle so that other code can 100 // The name of a key to store on the window handle so that other code can
102 // locate this object using just the handle. 101 // locate this object using just the handle.
103 static const char* const kBrowserViewKey = "__BROWSER_VIEW__"; 102 #if defined(OS_WIN)
103 static const wchar_t* kBrowserViewKey = L"__BROWSER_VIEW__";
104 #else
105 static const char* kBrowserViewKey = "__BROWSER_VIEW__";
106 #endif
104 // How frequently we check for hung plugin windows. 107 // How frequently we check for hung plugin windows.
105 static const int kDefaultHungPluginDetectFrequency = 2000; 108 static const int kDefaultHungPluginDetectFrequency = 2000;
106 // How long do we wait before we consider a window hung (in ms). 109 // How long do we wait before we consider a window hung (in ms).
107 static const int kDefaultPluginMessageResponseTimeout = 30000; 110 static const int kDefaultPluginMessageResponseTimeout = 30000;
108 // The number of milliseconds between loading animation frames. 111 // The number of milliseconds between loading animation frames.
109 static const int kLoadingAnimationFrameTimeMs = 30; 112 static const int kLoadingAnimationFrameTimeMs = 30;
110 // The amount of space we expect the window border to take up. 113 // The amount of space we expect the window border to take up.
111 static const int kWindowBorderWidth = 5; 114 static const int kWindowBorderWidth = 5;
112 115
113 // If not -1, windows are shown with this state. 116 // If not -1, windows are shown with this state.
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 479
477 // Explicitly set browser_ to NULL. 480 // Explicitly set browser_ to NULL.
478 browser_.reset(); 481 browser_.reset();
479 } 482 }
480 483
481 // static 484 // static
482 BrowserView* BrowserView::GetBrowserViewForNativeWindow( 485 BrowserView* BrowserView::GetBrowserViewForNativeWindow(
483 gfx::NativeWindow window) { 486 gfx::NativeWindow window) {
484 #if defined(OS_WIN) 487 #if defined(OS_WIN)
485 if (IsWindow(window)) { 488 if (IsWindow(window)) {
486 return reinterpret_cast<BrowserView*>( 489 HANDLE data = GetProp(window, kBrowserViewKey);
487 app::ViewProp::GetValue(window, kBrowserViewKey)); 490 if (data)
491 return reinterpret_cast<BrowserView*>(data);
488 } 492 }
489 #else 493 #else
490 if (window) { 494 if (window) {
491 return static_cast<BrowserView*>( 495 return static_cast<BrowserView*>(
492 g_object_get_data(G_OBJECT(window), kBrowserViewKey)); 496 g_object_get_data(G_OBJECT(window), kBrowserViewKey));
493 } 497 }
494 #endif 498 #endif
495 return NULL; 499 return NULL;
496 } 500 }
497 501
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 /////////////////////////////////////////////////////////////////////////////// 1882 ///////////////////////////////////////////////////////////////////////////////
1879 // BrowserView, private: 1883 // BrowserView, private:
1880 1884
1881 void BrowserView::Init() { 1885 void BrowserView::Init() {
1882 accessible_view_helper_.reset(new AccessibleViewHelper( 1886 accessible_view_helper_.reset(new AccessibleViewHelper(
1883 this, browser_->profile())); 1887 this, browser_->profile()));
1884 1888
1885 SetLayoutManager(CreateLayoutManager()); 1889 SetLayoutManager(CreateLayoutManager());
1886 // Stow a pointer to this object onto the window handle so that we can get 1890 // Stow a pointer to this object onto the window handle so that we can get
1887 // at it later when all we have is a native view. 1891 // at it later when all we have is a native view.
1892 #if defined(OS_WIN)
1888 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); 1893 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this);
1894 #else
1895 g_object_set_data(G_OBJECT(GetWidget()->GetNativeView()),
1896 kBrowserViewKey, this);
1897 #endif
1889 1898
1890 // Start a hung plugin window detector for this browser object (as long as 1899 // Start a hung plugin window detector for this browser object (as long as
1891 // hang detection is not disabled). 1900 // hang detection is not disabled).
1892 if (!CommandLine::ForCurrentProcess()->HasSwitch( 1901 if (!CommandLine::ForCurrentProcess()->HasSwitch(
1893 switches::kDisableHangMonitor)) { 1902 switches::kDisableHangMonitor)) {
1894 InitHangMonitor(); 1903 InitHangMonitor();
1895 } 1904 }
1896 1905
1897 LoadAccelerators(); 1906 LoadAccelerators();
1898 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); 1907 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2504 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME)); 2513 SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
2505 2514
2506 return view; 2515 return view;
2507 } 2516 }
2508 #endif 2517 #endif
2509 2518
2510 // static 2519 // static
2511 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2520 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2512 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2521 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2513 } 2522 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.cc ('k') | views/accessibility/view_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698