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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
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/layout_mode_button.h" 5 #include "chrome/browser/chromeos/frame/layout_mode_button.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/wm_ipc.h" 9 #include "chrome/browser/chromeos/wm_ipc.h"
10 #include "chrome/common/chrome_notification_types.h"
10 #include "content/common/notification_details.h" 11 #include "content/common/notification_details.h"
11 #include "content/common/notification_source.h" 12 #include "content/common/notification_source.h"
12 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
13 #include "grit/theme_resources.h" 14 #include "grit/theme_resources.h"
14 #include "third_party/cros/chromeos_wm_ipc_enums.h" 15 #include "third_party/cros/chromeos_wm_ipc_enums.h"
15 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
17 #include "views/widget/widget.h" 18 #include "views/widget/widget.h"
18 19
19 namespace { 20 namespace {
(...skipping 15 matching lines...) Expand all
35 return size; 36 return size;
36 } 37 }
37 38
38 bool LayoutModeButton::HitTest(const gfx::Point& l) const { 39 bool LayoutModeButton::HitTest(const gfx::Point& l) const {
39 // Handle events above our bounds so that we'll see clicks occuring in the 40 // Handle events above our bounds so that we'll see clicks occuring in the
40 // padding between the top of the screen and the button. 41 // padding between the top of the screen and the button.
41 const gfx::Point point(l.x(), std::max(y(), l.y())); 42 const gfx::Point point(l.x(), std::max(y(), l.y()));
42 return ImageButton::HitTest(point); 43 return ImageButton::HitTest(point);
43 } 44 }
44 45
45 void LayoutModeButton::Observe(NotificationType type, 46 void LayoutModeButton::Observe(int type,
46 const NotificationSource& source, 47 const NotificationSource& source,
47 const NotificationDetails& details) { 48 const NotificationDetails& details) {
48 DCHECK(type == NotificationType::LAYOUT_MODE_CHANGED); 49 DCHECK(type == chrome::NOTIFICATION_LAYOUT_MODE_CHANGED);
49 UpdateForCurrentLayoutMode(); 50 UpdateForCurrentLayoutMode();
50 } 51 }
51 52
52 void LayoutModeButton::Init() { 53 void LayoutModeButton::Init() {
53 WmIpc* wm_ipc = WmIpc::instance(); 54 WmIpc* wm_ipc = WmIpc::instance();
54 registrar_.Add(this, 55 registrar_.Add(this,
55 NotificationType::LAYOUT_MODE_CHANGED, 56 chrome::NOTIFICATION_LAYOUT_MODE_CHANGED,
56 Source<WmIpc>(wm_ipc)); 57 Source<WmIpc>(wm_ipc));
57 UpdateForCurrentLayoutMode(); 58 UpdateForCurrentLayoutMode();
58 } 59 }
59 60
60 void LayoutModeButton::ButtonPressed(views::Button* sender, 61 void LayoutModeButton::ButtonPressed(views::Button* sender,
61 const views::Event& event) { 62 const views::Event& event) {
62 DCHECK_EQ(sender, this); 63 DCHECK_EQ(sender, this);
63 WmIpc* wm_ipc = WmIpc::instance(); 64 WmIpc* wm_ipc = WmIpc::instance();
64 const WmIpcLayoutMode mode = wm_ipc->layout_mode(); 65 const WmIpcLayoutMode mode = wm_ipc->layout_mode();
65 66
(...skipping 25 matching lines...) Expand all
91 SetImage(BS_NORMAL, rb.GetBitmapNamed(IDR_STATUSBAR_WINDOW_MAXIMIZE)); 92 SetImage(BS_NORMAL, rb.GetBitmapNamed(IDR_STATUSBAR_WINDOW_MAXIMIZE));
92 SetTooltipText(UTF16ToWide( 93 SetTooltipText(UTF16ToWide(
93 l10n_util::GetStringUTF16(IDS_STATUSBAR_WINDOW_MAXIMIZE_TOOLTIP))); 94 l10n_util::GetStringUTF16(IDS_STATUSBAR_WINDOW_MAXIMIZE_TOOLTIP)));
94 break; 95 break;
95 default: 96 default:
96 DLOG(WARNING) << "Unknown layout mode " << mode; 97 DLOG(WARNING) << "Unknown layout mode " << mode;
97 } 98 }
98 } 99 }
99 100
100 } // namespace chromeos 101 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/frame/layout_mode_button.h ('k') | chrome/browser/chromeos/frame/panel_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698