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

Side by Side Diff: chrome/browser/chromeos/status_area_view.h

Issue 215025: Make chromeos build use shared object to load battery... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « chrome/browser/chromeos/DEPS ('k') | chrome/browser/chromeos/status_area_view.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "third_party/chromeos_power/chromeos_power.h"
9 #include "views/controls/menu/simple_menu_model.h" 10 #include "views/controls/menu/simple_menu_model.h"
10 #include "views/controls/menu/view_menu_delegate.h" 11 #include "views/controls/menu/view_menu_delegate.h"
11 #include "views/view.h" 12 #include "views/view.h"
12 13
13 class Browser; 14 class Browser;
14 15
15 namespace views { 16 namespace views {
16 class MenuButton; 17 class MenuButton;
17 class ImageView; 18 class ImageView;
18 } 19 }
(...skipping 29 matching lines...) Expand all
48 // views::SimpleMenuModel::Delegate implementation. 49 // views::SimpleMenuModel::Delegate implementation.
49 virtual bool IsCommandIdChecked(int command_id) const; 50 virtual bool IsCommandIdChecked(int command_id) const;
50 virtual bool IsCommandIdEnabled(int command_id) const; 51 virtual bool IsCommandIdEnabled(int command_id) const;
51 virtual bool GetAcceleratorForCommandId(int command_id, 52 virtual bool GetAcceleratorForCommandId(int command_id,
52 views::Accelerator* accelerator); 53 views::Accelerator* accelerator);
53 virtual void ExecuteCommand(int command_id); 54 virtual void ExecuteCommand(int command_id);
54 55
55 // views::ViewMenuDelegate implementation. 56 // views::ViewMenuDelegate implementation.
56 virtual void RunMenu(views::View* source, const gfx::Point& pt, 57 virtual void RunMenu(views::View* source, const gfx::Point& pt,
57 gfx::NativeView hwnd); 58 gfx::NativeView hwnd);
59 // Called whenever the battery status changes.
60 void PowerStatusChanged(const chromeos::PowerStatus& status);
61
62 static void LoadPowerLibrary();
63 // Called whenever the battery status changes. Dispatches to
64 // PowerStatusChanged() instance method.
65 static void PowerStatusChangedHandler(
66 void* object, const chromeos::PowerStatus& status);
58 67
59 // The browser window that owns us. 68 // The browser window that owns us.
60 Browser* browser_; 69 Browser* browser_;
61 70
62 views::ImageView* battery_view_; 71 views::ImageView* battery_view_;
63 views::MenuButton* menu_view_; 72 views::MenuButton* menu_view_;
64 73
65 scoped_ptr<views::SimpleMenuModel> app_menu_contents_; 74 scoped_ptr<views::SimpleMenuModel> app_menu_contents_;
66 scoped_ptr<views::SimpleMenuModel> options_menu_contents_; 75 scoped_ptr<views::SimpleMenuModel> options_menu_contents_;
67 scoped_ptr<views::Menu2> app_menu_menu_; 76 scoped_ptr<views::Menu2> app_menu_menu_;
77 // A reference to the battery power api, to allow callbacks when the
78 // battery status changes.
79 chromeos::PowerStatusConnection power_status_connection_;
68 80
69 static OpenTabsMode open_tabs_mode_; 81 static OpenTabsMode open_tabs_mode_;
82 // Handle to result of dlopen() of the power shared object.
83 static void* power_library_;
84 // True if there was an error loading the power shared object.
85 static bool power_library_error_;
70 86
71 DISALLOW_COPY_AND_ASSIGN(StatusAreaView); 87 DISALLOW_COPY_AND_ASSIGN(StatusAreaView);
72 }; 88 };
73 89
74 #endif // CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_ 90 #endif // CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/DEPS ('k') | chrome/browser/chromeos/status_area_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698