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

Side by Side Diff: chrome/browser/ui/panels/panel_manager.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 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) 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/ui/panels/panel_manager.h" 5 #include "chrome/browser/ui/panels/panel_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // See usage below. 44 // See usage below.
45 #if defined(OS_MACOSX) 45 #if defined(OS_MACOSX)
46 const int kMillisecondsBeforeCollapsingFromTitleOnlyState = 3000; 46 const int kMillisecondsBeforeCollapsingFromTitleOnlyState = 3000;
47 #else 47 #else
48 const int kMillisecondsBeforeCollapsingFromTitleOnlyState = 0; 48 const int kMillisecondsBeforeCollapsingFromTitleOnlyState = 0;
49 #endif 49 #endif
50 } // namespace 50 } // namespace
51 51
52 // static 52 // static
53 PanelManager* PanelManager::GetInstance() { 53 PanelManager* PanelManager::GetInstance() {
54 static base::LazyInstance<PanelManager> instance(base::LINKER_INITIALIZED); 54 static base::LazyInstance<PanelManager> instance = LAZY_INSTANCE_INITIALIZER;
55 return instance.Pointer(); 55 return instance.Pointer();
56 } 56 }
57 57
58 PanelManager::PanelManager() 58 PanelManager::PanelManager()
59 : minimized_panel_count_(0), 59 : minimized_panel_count_(0),
60 are_titlebars_up_(false), 60 are_titlebars_up_(false),
61 dragging_panel_index_(kInvalidPanelIndex), 61 dragging_panel_index_(kInvalidPanelIndex),
62 dragging_panel_original_x_(0), 62 dragging_panel_original_x_(0),
63 delayed_titlebar_action_(NO_ACTION), 63 delayed_titlebar_action_(NO_ACTION),
64 remove_delays_for_testing_(false), 64 remove_delays_for_testing_(false),
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // Start from the bottom to avoid reshuffling. 608 // Start from the bottom to avoid reshuffling.
609 for (Panels::reverse_iterator iter = panels_copy.rbegin(); 609 for (Panels::reverse_iterator iter = panels_copy.rbegin();
610 iter != panels_copy.rend(); ++iter) 610 iter != panels_copy.rend(); ++iter)
611 (*iter)->Close(); 611 (*iter)->Close();
612 } 612 }
613 613
614 bool PanelManager::is_dragging_panel() const { 614 bool PanelManager::is_dragging_panel() const {
615 return dragging_panel_index_ != kInvalidPanelIndex; 615 return dragging_panel_index_ != kInvalidPanelIndex;
616 } 616 }
617 617
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698