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

Side by Side Diff: chrome/browser/views/go_button.cc

Issue 62154: Implement stop/go button for Linux (Closed)
Patch Set: Add a small DCHECK => DCHECK_NE change. Created 11 years, 8 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
« no previous file with comments | « chrome/browser/views/go_button.h ('k') | chrome/chrome.gyp » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/go_button.h" 5 #include "chrome/browser/views/go_button.h"
6 6
7 #include "base/message_loop.h"
7 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
8 #include "chrome/browser/browser.h" 9 #include "chrome/browser/browser.h"
9 #include "chrome/browser/views/event_utils.h" 10 #include "chrome/browser/views/event_utils.h"
10 #include "chrome/browser/views/location_bar_view.h" 11 #include "chrome/browser/views/location_bar_view.h"
11 #include "chrome/common/l10n_util.h" 12 #include "chrome/common/l10n_util.h"
12 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
13 14
14 //////////////////////////////////////////////////////////////////////////////// 15 ////////////////////////////////////////////////////////////////////////////////
15 // GoButton, public: 16 // GoButton, public:
16 17
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 MessageLoop::current()->PostDelayedTask(FROM_HERE, 91 MessageLoop::current()->PostDelayedTask(FROM_HERE,
91 stop_timer_.NewRunnableMethod(&GoButton::OnButtonTimer), 92 stop_timer_.NewRunnableMethod(&GoButton::OnButtonTimer),
92 button_delay_); 93 button_delay_);
93 } 94 }
94 } 95 }
95 96
96 //////////////////////////////////////////////////////////////////////////////// 97 ////////////////////////////////////////////////////////////////////////////////
97 // GoButton, View overrides: 98 // GoButton, View overrides:
98 99
99 void GoButton::OnMouseExited(const views::MouseEvent& e) { 100 void GoButton::OnMouseExited(const views::MouseEvent& e) {
100 using namespace views;
101
102 if (visible_mode_ != intended_mode_) 101 if (visible_mode_ != intended_mode_)
103 ChangeMode(intended_mode_); 102 ChangeMode(intended_mode_);
104 103
105 if (state() != BS_DISABLED) 104 if (state() != BS_DISABLED)
106 SetState(BS_NORMAL); 105 SetState(BS_NORMAL);
107 } 106 }
108 107
109 bool GoButton::GetTooltipText(int x, int y, std::wstring* tooltip) { 108 bool GoButton::GetTooltipText(int x, int y, std::wstring* tooltip) {
110 if (visible_mode_ == MODE_STOP) { 109 if (visible_mode_ == MODE_STOP) {
111 tooltip->assign(l10n_util::GetString(IDS_TOOLTIP_STOP)); 110 tooltip->assign(l10n_util::GetString(IDS_TOOLTIP_STOP));
(...skipping 27 matching lines...) Expand all
139 138
140 //////////////////////////////////////////////////////////////////////////////// 139 ////////////////////////////////////////////////////////////////////////////////
141 // GoButton, private: 140 // GoButton, private:
142 141
143 void GoButton::OnButtonTimer() { 142 void GoButton::OnButtonTimer() {
144 if (intended_mode_ != visible_mode_) 143 if (intended_mode_ != visible_mode_)
145 ChangeMode(intended_mode_); 144 ChangeMode(intended_mode_);
146 145
147 stop_timer_.RevokeAll(); 146 stop_timer_.RevokeAll();
148 } 147 }
OLDNEW
« no previous file with comments | « chrome/browser/views/go_button.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698